Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def nlp_text_manager(text_path, name):
- text = text_path
- txt = Path(text_path).read_text(encoding='cp1252')
- service = discovery.build('language', 'v1beta2', credentials=credentials)
- service_request = service.documents().analyzeSentiment(
- body={
- 'document': {
- 'type': 'PLAIN_TEXT',
- 'content': txt
- }
- }
- )
- response = service_request.execute()
- return response
Add Comment
Please, Sign In to add comment