Skip to content

Instantly share code, notes, and snippets.

@erichare
Created July 14, 2022 15:38
Show Gist options
  • Save erichare/6b731b2b4d2e89617c6a5c62393841bf to your computer and use it in GitHub Desktop.
Save erichare/6b731b2b4d2e89617c6a5c62393841bf to your computer and use it in GitHub Desktop.
Sample of the code of the sentiment analysis Daisi
import tensorflow as tf
from transformers import pipeline
sentiment_task = pipeline("sentiment-analysis", model="sentiment-roberta-large-english", tokenizer="sentiment-roberta-large-english")
def get_sentiment(text):
'''
Use a Sentiment Detection model on the given text
...
'''
return sentiment_task(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment