Code Monkey home page Code Monkey logo

keyword-generator's Introduction

Keyword Generator

The Keyword Generator, created in collaboration with KB Researcher-in-residence Pim Huijnen, is a command-line tool that offers two methods to extract relevant keywords from a collection of sample texts provided by the user:

  1. keywords_tfidf.py, extracting keywords based on tf-idf scores. Options:
  • -k : number of keywords to be generated (default 10)
  • -d : document length (the documents provided by the user will be split into parts containing the specified number of words; by default the documents will not be split.)
  1. keywords_lda.py, extracting keywords based on either Gensim's or Mallet's implementation of LDA topic modeling. Options:
  • -t : number of topics (default 10)
  • -w : number of words per topic (default 10)
  • -k : number of keywords (default 10)
  • -d : document length (the documents provided by the user will be split into parts containing the specified number of words; by default the documents will not be split.)
  • m : mallet path (full path to the Mallet executable; if not provided, Gensim's LDA implementation will be used to generate topics.)

Documents are to be placed in the data/documents folder, stop word lists in the data/stop_words folder. The keyword lists and any topics and topic distributions generated will be saved in the data/results folder.

The Keyword Generator currently uses Python 2.7, and Gensim and Mallet need to be installed locally.

Some examples of commands:

$ ./keywords_tfidf.py
$ ./keywords_tfidf.py -k 20 -d 100
$ ./keywords_lda.py -k 10 -d 100 -t 5 -w 20
$ ./keywords_lda.py -k 10 -d 100 -t 5 -w 20 -m /opt/mallet-2.0.7/bin/mallet

keyword-generator's People

Contributors

jlonij avatar

Watchers

James Cloos avatar  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.