{"id":46725,"date":"2022-10-06T00:00:00","date_gmt":"2022-10-06T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/a-text-classifier-using-java-and-griddb\/"},"modified":"2025-11-13T12:56:16","modified_gmt":"2025-11-13T20:56:16","slug":"a-text-classifier-using-java-and-griddb","status":"publish","type":"post","link":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/","title":{"rendered":"A Text Classifier Using Java and GridDB"},"content":{"rendered":"<p>Text data can be found everywhere, including in emails, chat conversations, social media, and websites. Text data is full of information, but extracting this information can be difficult due to its unstructured nature. Extracting insights from unstructured data can be expensive and time-consuming as much time will be spent sorting the data.<\/p>\n<p>Text classifiers that use Natural Language Processing (NLP) techniques provide an alternative way to structure data in a fast, scalable, and cost-effective way.<\/p>\n<p>The process of text classification involves organizing text into groups. It is also known as <em>Text Tagging<\/em> or <em>Text Categorization<\/em>. With NLP, it is possible to analyze text data and assign it to pre-defined categories based on the content.<\/p>\n<p>In this article, we will implement a text classifier using Java and GridDB. The purpose of the text classifier will be to classify an email as either spam or ham.<\/p>\n<p>Full source and data can be found here: <a href=\"https:\/\/github.com\/griddbnet\/Blogs\/tree\/text-classifier\">https:\/\/github.com\/griddbnet\/Blogs\/tree\/text-classifier<\/a><\/p>\n<h2>Data Description<\/h2>\n<p>The data to be used shows whether an email is spam or ham. The data has been stored in a comma separated values (CSV) file named <code>smsspam.csv<\/code>. There are two fields in the data namely <code>spamclass<\/code> and <code>text<\/code>. The first field shows whether the email is spam or ham and it takes only two values, <code>spam<\/code>, and <code>ham<\/code>. The second field shows the email text.<\/p>\n<h2>Store the Data in GridDB<\/h2>\n<p>It is possible for us to use the data directly from the CSV file. However, GridDB comes with a number of benefits including data organization and improved query performance. That&#8217;s why we will move the data from the CVS file into GridDB.<\/p>\n<p>Let&#8217;s start by importing a number of libraries to help us in storing the data in GridDB:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">import java.io.File;\nimport java.util.Scanner;\nimport java.io.IOException;\nimport java.util.Collection;\nimport java.util.Properties;\n\nimport com.toshiba.mwcloud.gs.Query;\nimport com.toshiba.mwcloud.gs.RowKey;\nimport com.toshiba.mwcloud.gs.RowSet;\nimport com.toshiba.mwcloud.gs.GridStore;\nimport com.toshiba.mwcloud.gs.Collection;\nimport com.toshiba.mwcloud.gs.GSException;\nimport com.toshiba.mwcloud.gs.GridStoreFactory;<\/code><\/pre>\n<\/div>\n<p>GridDB groups data into containers. Let us create a static Java class to represent the GridDB container where the data will be stored:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">public static class EmailClassification{\n    \n    @RowKey String spamclass;\n     String text;\n    }<\/code><\/pre>\n<\/div>\n<p>The above static class has two variables. These two variables correspond to the two columns of the GridDB container.<\/p>\n<p>To move the data to GridDB, we must connect Java to GridDB. The following code can help us to achieve this:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">        Properties props = new Properties();\n        props.setProperty(\"notificationAddress\", \"239.0.0.1\");\n        props.setProperty(\"notificationPort\", \"31999\");\n        props.setProperty(\"clusterName\", \"defaultCluster\");\n        props.setProperty(\"user\", \"admin\");\n        props.setProperty(\"password\", \"admin\");\n        GridStore store = GridStoreFactory.getInstance().getGridStore(props);<\/code><\/pre>\n<\/div>\n<p>Replace the above details with the specifics of your GridDB installation.<\/p>\n<p>We can now select the container into which we need to store the data:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">        Collection&lt;String, EmailClassification> coll = store.putCollection(\"col01\", EmailClassification.class);<\/code><\/pre>\n<\/div>\n<p>We have created an instance of the container. This instance can now be used to refer to the container.<\/p>\n<p>Let&#8217;s now pull the data from the CSV file and insert it into GridDB:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">File file1 = new File(\"smsspam.csv\");\n                Scanner sc = new Scanner(file1);\n                String data = sc.next();\n \n                while (sc.hasNext()){\n                    \n                        String scData = sc.next();\n                        String dataList[] = scData.split(\",\");\n                        String spamclass = dataList[0];\n                        String text = dataList[1];\n                        \n                        EmailClassification ec = new EmailClassification();\n                        ec.spamclass = spamclass;\n                        ec.text = text;\n                                                \n                                               \n                        coll.append(ec);\n                 }<\/code><\/pre>\n<\/div>\n<p>The above code will pull the data from the CSV file and insert it into the GridDB container.<\/p>\n<h2>Retrieve the Data<\/h2>\n<p>We want to use the data for text classification. So, let us retrieve the data from the GridDB container:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">Query&lt;emailclassification> query = coll.query(\"select *\");\n   RowSet&lt;\/emailclassification>&lt;emailclassification> rs = query.fetch(false);\n   RowSet res = query.fetch();&lt;\/emailclassification><\/code><\/pre>\n<\/div>\n<p>The <code>select *<\/code> statement helped us to select all the data stored in the GridDB container.<\/p>\n<h2>Implement the Text Classify<\/h2>\n<p>Now that our data is ready, we can go ahead and implement the text classifier. Let&#8217;s first import the libraries that we will use to implement the text classifier:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">import java.io.*;\nimport weka.core.*;\nimport java.util.List;\nimport java.util.Random;\nimport weka.filters.Filter;\nimport java.util.ArrayList;\nimport weka.core.Instances;\nimport weka.core.FastVector;\nimport weka.classifiers.Evaluation;\nimport weka.classifiers.bayes.NaiveBayes;\nimport weka.classifiers.meta.FilteredClassifier;\nimport weka.core.converters.ArffLoader.ArffReader;\nimport weka.filters.unsupervised.attribute.StringToWordVector;<\/code><\/pre>\n<\/div>\n<p>Create a buffered reader for the dataset:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">BufferedReader bufferedReader\n                = new BufferedReader(\n                    new FileReader(res));\n \n            \/\/ Create dataset instances\n            Instances datasetInstances\n                = new Instances(bufferedReader);<\/code><\/pre>\n<\/div>\n<p>We can now implement the text classifier. We will combine a <code>StringToWordVector<\/code> filter (to help us represent our text in the form of feature vectors) with a <code>NaiveBayes<\/code> classifier (to facilitate learning).<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">datasetInstances.setClassIndex(0);\n   StringToWordVector filter = new StringToWordVector();\n   filter.setAttributeIndices(\"last\");\n   FilteredClassifier classifier = new FilteredClassifier();\n   classifier.setFilter(filter);\n   classifier.setClassifier(new NaiveBayes());\n   classifier.buildClassifier(datasetInstances);\n   System.out.println(classifier);<\/code><\/pre>\n<\/div>\n<p>The class of the dataset has been set to the first attribute. We have then created a filter and set the attribute which is to be transformed from text into a feature factor. We have then created an object of the <code>FilteredClassifier<\/code> class and added the previous filter as well as a new <code>NaiveBayes<\/code> classifier to it. The dataset should have the class as the first attribute and the text as the second attribute.<\/p>\n<h2>Evaluate the Model<\/h2>\n<p>We can now evaluate the model to see its performance statistics. The following code can help us to achieve this:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">Evaluation eval = new Evaluation(datasetInstances);\n   eval.crossValidateModel(classifier, datasetInstances, 4, new Random(1));\n   System.out.println(eval.toSummaryString());<\/code><\/pre>\n<\/div>\n<p>The code will return the evaluation metrics for the text classifier.<\/p>\n<h2>Classify Text<\/h2>\n<p>Now that our model is ready, we can use it to make predictions. The purpose of making predictions should be to classify emails as either spam or ham.<\/p>\n<p>Let us classify the last instance of the dataset as either spam or ham. The following code demonstrates this:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">Instance pred = datasetInstances.lastInstance();\n      double answer = classifier.classifyInstance(pred);\n      System.out.println(\"Class predicted: \" + pred.classAttribute().value((int) answer));<\/code><\/pre>\n<\/div>\n<h2>Compile and Run the Model<\/h2>\n<p>To compile and run the model, you will need the Weka API. Download it from the following URL:<\/p>\n<p>http:\/\/www.java2s.com\/Code\/Jar\/w\/weka.htm<\/p>\n<p>Next, login as the <code>gsadm<\/code> user. Move your <code>.java<\/code> file to the <code>bin<\/code> folder of your GridDB located in the following path:<\/p>\n<p>\/griddb_4.6.0-1_amd64\/usr\/griddb-4.6.0\/bin<\/p>\n<p>Run the following command on your Linux terminal to set the path for the gridstore.jar file:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">export CLASSPATH=$CLASSPATH:\/home\/osboxes\/Downloads\/griddb_4.6.0-1_amd64\/usr\/griddb-4.6.0\/bin\/gridstore.jar<\/code><\/pre>\n<\/div>\n<p>Next, use the following command to compile your <code>.java<\/code> file:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">javac -cp weka-3-7-0\/weka.jar TextClassification.java<\/code><\/pre>\n<\/div>\n<p>Run the .class file that is generated by running the following command:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">java -cp .:weka-3-7-0\/weka.jar TextClassification<\/code><\/pre>\n<\/div>\n<p>The text classifier correctly classified the email as <code>ham<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Text data can be found everywhere, including in emails, chat conversations, social media, and websites. Text data is full of information, but extracting this information can be difficult due to its unstructured nature. Extracting insights from unstructured data can be expensive and time-consuming as much time will be spent sorting the data. Text classifiers that [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":28834,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46725","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A Text Classifier Using Java and GridDB | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"Text data can be found everywhere, including in emails, chat conversations, social media, and websites. Text data is full of information, but extracting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Text Classifier Using Java and GridDB | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"Text data can be found everywhere, including in emails, chat conversations, social media, and websites. Text data is full of information, but extracting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-06T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:56:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2022\/08\/text-classifier.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1160\" \/>\n\t<meta property=\"og:image:height\" content=\"653\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"griddb-admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"A Text Classifier Using Java and GridDB\",\"datePublished\":\"2022-10-06T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:56:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/\"},\"wordCount\":800,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2022\/08\/text-classifier.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/\",\"name\":\"A Text Classifier Using Java and GridDB | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2022\/08\/text-classifier.png\",\"datePublished\":\"2022-10-06T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:56:16+00:00\",\"description\":\"Text data can be found everywhere, including in emails, chat conversations, social media, and websites. Text data is full of information, but extracting\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2022\/08\/text-classifier.png\",\"contentUrl\":\"\/wp-content\/uploads\/2022\/08\/text-classifier.png\",\"width\":1160,\"height\":653},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Text Classifier Using Java and GridDB | GridDB: Open Source Time Series Database for IoT","description":"Text data can be found everywhere, including in emails, chat conversations, social media, and websites. Text data is full of information, but extracting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/","og_locale":"en_US","og_type":"article","og_title":"A Text Classifier Using Java and GridDB | GridDB: Open Source Time Series Database for IoT","og_description":"Text data can be found everywhere, including in emails, chat conversations, social media, and websites. Text data is full of information, but extracting","og_url":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2022-10-06T07:00:00+00:00","article_modified_time":"2025-11-13T20:56:16+00:00","og_image":[{"width":1160,"height":653,"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2022\/08\/text-classifier.png","type":"image\/png"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"griddb-admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"A Text Classifier Using Java and GridDB","datePublished":"2022-10-06T07:00:00+00:00","dateModified":"2025-11-13T20:56:16+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/"},"wordCount":800,"commentCount":0,"publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2022\/08\/text-classifier.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/","url":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/","name":"A Text Classifier Using Java and GridDB | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2022\/08\/text-classifier.png","datePublished":"2022-10-06T07:00:00+00:00","dateModified":"2025-11-13T20:56:16+00:00","description":"Text data can be found everywhere, including in emails, chat conversations, social media, and websites. Text data is full of information, but extracting","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/a-text-classifier-using-java-and-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2022\/08\/text-classifier.png","contentUrl":"\/wp-content\/uploads\/2022\/08\/text-classifier.png","width":1160,"height":653},{"@type":"WebSite","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/comments?post=46725"}],"version-history":[{"count":1,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46725\/revisions"}],"predecessor-version":[{"id":51397,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46725\/revisions\/51397"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media\/28834"}],"wp:attachment":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media?parent=46725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/categories?post=46725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/tags?post=46725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}