{"id":19215317,"url":"https://github.com/krisharul26/text-classification-dbpedia-ontology-classes-using-lstm","last_synced_at":"2026-01-22T07:01:41.954Z","repository":{"id":163617063,"uuid":"425071676","full_name":"KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM","owner":"KrishArul26","description":"Text classification is the task of assigning a set of predefined categories to free text. Text classifiers can be used to organize, structure, and categorize pretty much anything. For example, new articles can be organized by topics, support tickets can be organized by urgency, chat conversations can be organized by language, brand mentions can be organized by sentiment, and so on.","archived":false,"fork":false,"pushed_at":"2021-11-17T19:43:50.000Z","size":28648,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T18:47:47.825Z","etag":null,"topics":["attention-mechanism","bagofwords","flask-application","gensim-doc2vec","gensim-word2vec","glove-embeddings","lemmatization","lstm-neural-networks","nlp-machine-learning","nltk-python","restapi-framework","rnn-tensorflow","stemming","tensorflow2","word2vec-embeddinngs","word2vec-model"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KrishArul26.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-05T20:07:36.000Z","updated_at":"2025-03-14T17:54:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6250d8b-fcac-49e0-8908-2f95f983c780","html_url":"https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrishArul26%2FText-Classification-DBpedia-ontology-classes-Using-LSTM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrishArul26%2FText-Classification-DBpedia-ontology-classes-Using-LSTM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrishArul26%2FText-Classification-DBpedia-ontology-classes-Using-LSTM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrishArul26%2FText-Classification-DBpedia-ontology-classes-Using-LSTM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KrishArul26","download_url":"https://codeload.github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrishArul26%2FText-Classification-DBpedia-ontology-classes-Using-LSTM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28657544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attention-mechanism","bagofwords","flask-application","gensim-doc2vec","gensim-word2vec","glove-embeddings","lemmatization","lstm-neural-networks","nlp-machine-learning","nltk-python","restapi-framework","rnn-tensorflow","stemming","tensorflow2","word2vec-embeddinngs","word2vec-model"],"created_at":"2024-11-09T14:13:19.757Z","updated_at":"2026-01-22T07:01:41.921Z","avatar_url":"https://github.com/KrishArul26.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch2 align=\"center\"\u003e  Text-Classification-Using-LSTM\u003c/h2\u003e\n\n### Table of Contents\n[Introduction](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM.git#Introduction)\n\n[Technologies Used](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM.git#Technologies-Used)\n\n[Dataset](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM.git#Dataset)\n\n[Process - Flow](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM.git#ProcessFlow)\n\n\n\u003ch3 align=\"left\"\u003e Ontology  Classification-Using-LSTM \u003c/h3\u003e\n\n \u003cp align=\"center\"\u003e\n  \u003cimg width=\"600\" src=\"https://user-images.githubusercontent.com/74568334/140572521-72125b9d-69c1-442e-9b74-ef60ce6a8b2e.png\"\u003e\n\u003c/p\u003e \n\n\u003ch3 align=\"left\"\u003eIntroduction \u003c/h3\u003e\n\n \n\u003cp style= 'text-align: justify;'\u003e Text classification is the task of assigning a set of predefined categories to free text. Text classifiers can be used to organize, structure, and categorize pretty much anything. For example, new articles can be organized by topics, support tickets can be organized by urgency, chat conversations can be organized by language, brand mentions can be organized by sentiment, and so on.\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"800\" src=\"https://user-images.githubusercontent.com/74568334/140572780-58814fa5-52aa-4b52-bd1c-cfa70dc0ba65.jpeg\"\u003e\n\u003c/p\u003e \n\n\u003ch2 align=\"center\"\u003e Technologies Used \u003c/h2\u003e\n \n ```\n 1. IDE - Pycharm\n 2. LSTM - As a classification Deep learning Model\n 3. GPU - P-4000\n 4. Google Colab - Text Analysis\n 5. Flask- Rest API\n 6. Postman - API Tester\n 7. Gensim - Word2Vec embeddings\n \n ```\n \n\u003cp style= 'text-align: justify;'\u003e \n \n   🔑 Prerequisites\n      All the dependencies and required libraries are included in the file requirements.txt\n\n      Python 3.6\n \n\u003c/p\u003e\n\n\u003ch2 align=\"center\"\u003e Dataset \u003c/h2\u003e\n\n\u003cp style= 'text-align: justify;'\u003e The DBpedia ontology classification dataset is constructed by picking 14 non-overlapping classes from DBpedia 2014. They are listed in classes.txt. From each of thse 14 ontology classes, we randomly choose 40,000 training samples and 5,000 testing samples. Therefore, the total size of the training dataset is 560,000 and testing dataset 70,000. The files train.csv and test.csv contain all the training samples as comma-sparated values. There are 3 columns in them, corresponding to class index (1 to 14), title and content. The title and content are escaped using double quotes (\"), and any internal double quote is escaped by 2 double quotes (\"\"). There are no new lines in title or content. \u003c/p\u003e\n\nFor Dataset Please click [here](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM/tree/main/Data)\n\n\n\u003ch2 align=\"center\"\u003e Process - Flow of This project \u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"1000\" src=\"https://user-images.githubusercontent.com/74568334/140583675-fdc5484d-1886-4e2f-906e-2c1e8c187e29.png\"\u003e\n\u003c/p\u003e \n\n\u003ch2 align=\"center\"\u003e 🚀 Installation of Text-Classification-Using-LSTM\u003c/h2\u003e\n\n1. Clone the repo\n\n```\ngit clone https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM.git\n```\n2. Change your directory to the cloned repo\n\n```\ncd Text-Classification-DBpedia-ontology-classes-Using-LSTM\n\n```\n3. Create a Python 3.6 version of virtual environment name 'lstm' and activate it\n\n```\npip install virtualenv\n\nvirtualenv bert\n\nlstm\\Scripts\\activate\n\n```\n\n4. Now, run the following command in your Terminal/Command Prompt to install the libraries required!!!\n\n```\npip install -r requirements.txt\n\n```\n\n\u003ch2 align=\"center\"\u003e 💡 Working \u003c/h2\u003e\n\nType the following command:\n\n```\npython app.py\n\n```\nAfter that You will see the running IP adress just copy and paste into you browser and import or upload your speech then closk the predict button.\n\n\n\u003ch2 align=\"center\"\u003e Implementations \u003c/h2\u003e\n\n\u003ch4 align=\"left\"\u003e In this section, contains the project directory, explanation of each python file presents in the directory.  \u003c/h2\u003e\n\n\n\u003ch3 align=\"left\"\u003e1. Project Directory\u003c/h3\u003e\n\n\n\u003ch4 align=\"left\"\u003e Below picture illustrate the complete folder structure of this project.\u003c/h4\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"400\" src=\"https://user-images.githubusercontent.com/74568334/140577934-92f60e0d-c905-478e-be62-638bd6a7ad82.png\"\u003e\n\u003c/p\u003e \n\n\n2. [preprocess.py](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM/blob/main/Code/preprocess.py)\n\n\u003cp style= 'text-align: justify;'\u003e Below picture illustrate the preprocess.py file, It does the necessary text cleaning process such as removing punctuation, numbers, lemmatization. And it will create train_preprocessed, validation_preprocessed and test_preprocessed pickle files for the further analysis.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"400\" src=\"https://user-images.githubusercontent.com/74568334/140578710-2b346932-32c8-4f60-b9bf-b79fbb4fbf10.png\"\u003e\n\u003c/p\u003e \n\n3. [word_embedder_gensim.py](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM/blob/main/Code/word_embedder_gensim.py)\n\n\u003cp style= 'text-align: justify;'\u003e Below picture illustrate the word_embedder_gensim.py, After done with text pre-processing, this file will take those cleaned text as input and will be creating the Word2vec embedding for each word.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"400\" src=\"https://user-images.githubusercontent.com/74568334/140579065-79a7e215-1f8f-4715-816c-0247d007a520.png\"\u003e\n\u003c/p\u003e \n\n\n4. [rnn_w2v.py](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM/blob/main/Code/rnn_w2v.py)\n\n\u003cp style= 'text-align: justify;'\u003eBelow picture illustrate the rnn_w2v.py, After done with creating Word2vec for each word then those vectors will use as input for creating the LSTM model and Train the LSTM (RNN) model with body and Classes. \u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"400\" src=\"https://user-images.githubusercontent.com/74568334/140579999-d0ae2ac4-74bc-460d-82eb-3ee7cbb40a73.png\"\u003e\n\u003c/p\u003e \n\n5. [index.htmml](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM/blob/main/Code/index.html)\n\n\u003cp style= 'text-align: justify;'\u003eBelow picture illustrate the index.html file, these files use to create the web frame for us. \u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"400\" src=\"https://user-images.githubusercontent.com/74568334/140581823-b9f8a43a-e317-4e18-b895-0983d905cb60.png\"\u003e\n  \u003cimg width=\"600\" src=\"https://user-images.githubusercontent.com/74568334/140581821-30aca256-6442-4b0e-8e29-9bef67f2d118.png\"\u003e\n \n\u003c/p\u003e \n\n\n6.[main.py](https://github.com/KrishArul26/Text-Classification-DBpedia-ontology-classes-Using-LSTM/blob/main/Code/main.py)\n\u003cp style= 'text-align: justify;'\u003e Below picture illustrate the main.py, After evaluating the LSTM model, This files will create the Rest -API, To that It will use FLASK frameworks and get the request from the customer or client then It will Post into the prediction files and Answer will be deliver over the web browser.   \u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"400\" src=\"https://user-images.githubusercontent.com/74568334/140581040-86b02b9a-fb8c-4f10-9ebf-03e05573f7a6.png\"\u003e\n \n\u003c/p\u003e \n\n\u003ch3 align=\"left\"\u003e7. Testing Rest-API\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"600\" src=\"https://user-images.githubusercontent.com/74568334/140582438-f649af76-ef70-4e79-ba2f-cd63267c7bf2.png\"\u003e\n  \u003cimg width=\"600\" src=\"https://user-images.githubusercontent.com/74568334/140582453-653c4aa4-2a6d-47a6-9595-97f9dc8939dd.png\"\u003e\n \n\u003c/p\u003e \n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrisharul26%2Ftext-classification-dbpedia-ontology-classes-using-lstm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrisharul26%2Ftext-classification-dbpedia-ontology-classes-using-lstm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrisharul26%2Ftext-classification-dbpedia-ontology-classes-using-lstm/lists"}