Python for NLP: Working with the Gensim Library (Part 1)


This is the 10th article in my series of articles on Python for NLP. In my previous article, I explained how the StanfordCoreNLP library can be used to perform different NLP tasks.

In this article, we will explore the Gensim library, which is another extremely useful NLP library for Python. Gensim was primarily developed for topic modeling. However, it now supports a variety of other NLP tasks such as converting words to vectors (word2vec), document to vectors (doc2vec), finding text similarity, and text summarization.

In this article and the next article of the series, we will see how the Gensim library is used to perform these tasks.

Installing Gensim

If you use pip installer to install your Python libraries, you can use the following command to download the Gensim library:

$ pip install gensim

Alternatively, if you use the Anaconda distribution of Python, you can execute the following command to install the Gensim library:

$ conda install -c anaconda gensim

Let’s now see how we can perform different NLP tasks using the Gensim library.

Creating Dictionaries

Statistical algorithms work with numbers, however, natural languages contain

To finish reading, please visit source site