gaelmoccand / TextEntitiesAnalysis

Client for NLP google-api to retrieve and analyze entities for a text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Text Entity Analysis

Using Google Natural Language AI. This tool will retrieve entities from a text. It gives the sentiment analysis score on each entity and on the whole text. Additionally, it also provides the corresponding categories for the text. A xls file is generated to store all results. references:

1 Setup

1.1 Create virtual environment

$ python3 -m venv env
$ source env/bin/activate

1.2 Install packages and Google API key

$ python3 -m pip install -r requirements.txt

1.4 cloud sdk (only for Entity Analysis )

$ gcloud init (if not run automatically then select your project)
$ gcloud services enable language.googleapis.com
$ gcloud auth application-default login

1.4 set api key (for searchEntity only)

  • save api key in .api_key file

2 Usage Entity Analysis

$ python3 getEntity.py --lang en inputTextFile resultsXlsFile

3 Usage Entity Search

$ python3 searchEntity.py "Tesla"

About

Client for NLP google-api to retrieve and analyze entities for a text

License:MIT License


Languages

Language:Python 100.0%