Code Monkey home page Code Monkey logo

keyetm's Introduction

This is code that accompanies the paper titled "Keyword Assisted Embedded Topic Model" by Bahareh Harandizadeh, J. Hunter Priniski, and Fred Morstatter. ETM was originally published by Adji B. Dieng, Francisco J. R. Ruiz, and David M. Blei on a article titled Topic Modeling in Embedding Spaces. The backbone of this repo has been extracted from the ETM original code and an adoption code from it. Most of the original code was kept here, with some changes to equip ETM with the ability to incorporate user knowledge in the form of informative topic-level priors over the vocabulary.

Installation

Create a new virtual enviroment and install ETM model package using pip by running: pip install -U embedded_topic_model

Usage

You first need to create a config file and put it in configs folder(a sample for 20newsg dataset is provided). In the configuration file the following items should be set:

Dataset:
 - folder-path: the root folder path, all data files(result-file,data-file,sw-file) should be placed in the this path.
 - result-file: the results folder path
 - data-file: input file name
 - sw-file: seed_words file name
Model:
 - bs: batch_size
 - nt: number of topics
 - epochs: number of epochs
 - drop_out: drop_out percentage 
 - theta_act: activation function 
 - lr: learning rate 
 - lambda_theta: Lambda_1 
 - lambda_alpha: Lambda_2 
 - path: The path for save the trained model

Then go the the main director(~/embedded-topic-model_mod) and in the terminal running code using:

python run.py --config configs/name_config_file.yaml

Citation

To site KeyETM, please use the following link:

@article{harandizadeh2021keyword,
  title={Keyword Assisted Embedded Topic Model},
  author={Harandizadeh, Bahareh and Priniski, J Hunter and Morstatter, Fred},
  journal={arXiv preprint arXiv:2112.03101},
  year={2021}
}

keyetm's People

Contributors

bahareharandizade avatar ptakizawa 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.