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:
- https://cloud.google.com/natural-language/docs/quickstart-client-libraries
- https://cloud.google.com/natural-language/docs/analyzing-entities
- https://cloud.google.com/natural-language/docs/categories
$ python3 -m venv env
$ source env/bin/activate
$ python3 -m pip install -r requirements.txt
- download gcloud CLI and install it from https://cloud.google.com/sdk/docs/install
- create a project in your google cloud (https://cloud.google.com/resource-manager/docs/creating-managing-projects)
$ gcloud init (if not run automatically then select your project)
$ gcloud services enable language.googleapis.com
$ gcloud auth application-default login
- save api key in .api_key file
$ python3 getEntity.py --lang en inputTextFile resultsXlsFile
$ python3 searchEntity.py "Tesla"