xclasscode commited on
Commit
ad38258
·
verified ·
1 Parent(s): 182c8f4

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -6
main.py CHANGED
@@ -6,11 +6,7 @@ import database
6
 
7
  app = FastAPI()
8
  models.database.Base.metadata.create_all(bind=database.engine)
9
- distilled_student_sentiment_classifier = pipeline(
10
- model="lxyuan/distilbert-base-multilingual-cased-sentiments-student",
11
- return_all_scores=True
12
- )
13
-
14
  # Database session dependency
15
  def get_db():
16
  db = database.SessionLocal()
@@ -27,7 +23,7 @@ def create_sentiment_result(sentiment_result: schemas.SentimentResultCreate, tex
27
 
28
  try:
29
  text_content = text_input
30
- sentiment_analysis_result = distilled_student_sentiment_classifier(text_content)
31
 
32
  # Create a new SentimentResult instance
33
  new_sentiment_result = models.SentimentResult(
 
6
 
7
  app = FastAPI()
8
  models.database.Base.metadata.create_all(bind=database.engine)
9
+ pipe = pipeline("text-classification", model="lxyuan/distilbert-base-multilingual-cased-sentiments-student")
 
 
 
 
10
  # Database session dependency
11
  def get_db():
12
  db = database.SessionLocal()
 
23
 
24
  try:
25
  text_content = text_input
26
+ sentiment_analysis_result = pipe(text_content)
27
 
28
  # Create a new SentimentResult instance
29
  new_sentiment_result = models.SentimentResult(