GithubHelp home page GithubHelp logo

felixggj / topic-modelling Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3.65 MB

Topic Modelling for Academic Papers with NLP

License: MIT License

Python 12.71% HTML 87.29%
nlp topic-modeling gensim lda nltk

topic-modelling's Introduction

Topic Modelling with LDA

This repository contains a Python implementation of Latent Dirichlet Allocation (LDA) for topic modeling using the NLTK and Gensim libraries. The project aims to analyze text documents and identify prevalent topics using a statistical model.

Features

  • Text Preprocessing: Removes stopwords and punctuation, tokenizes, and lemmatizes the text.
  • Corpus Preparation: Converts a collection of text documents into a format that can be used by the LDA model.
  • LDA Model Training: Trains an LDA model to discover topics in a corpus.
  • Topic Prediction: Predicts topic distribution for new documents.
  • Model Evaluation: Evaluates the model using coherence scores.
  • Topic Visualization: Visualizes the topics using pyLDAvis.

Prerequisites

Before running this project, you will need the following:

  • Python 3.x
  • NLTK
  • Gensim
  • pyLDAvis

You can install the required packages using the following command:

pip install nltk gensim pyLDAvis

Usage

To use this project:

  1. Ensure all dependencies are installed.
  2. Download necessary NLTK data:
python -m nltk.downloader stopwords wordnet punkt
  1. Run the main.py script:
python main.py

This will process the predefined documents, train the LDA model, and save the topic visualization as an HTML file.

Visualization

After running the script, you can open the lda_visualization.html file generated in the root directory to view the topic distribution visualization.

Training datasets

Test dataset

License

This project is open-source and available under the MIT License.

topic-modelling's People

Contributors

felixggj avatar

Stargazers

Maud Helen Hovland avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.