Giter Club home page Giter Club logo

keyword-extract's Introduction

KeyWord Extractor Python

This is a simple library to extract keywords from a document using a corpus. Built in python 3.5.

DEPENDENCIES:

NLTK

INSTALLATION:

Installing dependencies:
    pip install --upgrade nltk
    In python Interpreter, run:
        import nltk
        nltk.download()
    Download the required packages : (pos_tagger, stop_words(optional))

Installing the package:
    Download or clone the package.
    On command line, run : python setup.py install

USAGE :

from keywords import KeyWords
from nltk.corpus import stopwords

with open('script.txt', 'r', encoding="utf8") as f:
    data = f.read()

with open('transcript_1.txt', 'r', encoding="utf8") as f1:
    corpus_1 = f1.read()

stopWords = stopwords.words('english')
keyword = KeyWords(corpus=corpus_1, stop_words=stopWords, alpha=0.8)
d = keyword.get_keywords(data, n=20)
for i in d:
    print("Keyword : %s \n Score : %f" %(i[0], i[1]))

Functionalities:

init :

Arguements:
    corpus (optional) : Add your own corpus for prioritizing keywords based on the corpus.
    stop_words : Your own stop_words list
    alpha (default 0.5) : Alpha is the weighting factor which decides how much weightage you want to give to the corpus.

get_keywords :

Arguements :
    text : Your data
    n(default 20) : Number of keywords you want to extract

keyword-extract's People

Contributors

ankushbhatia2 avatar asshatter 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.