Spaces:
Sleeping
Sleeping
Update app.py
Browse files20 unmodified lines21222324252627282920 unmodified linesdef classify_text_azure(model, text):# Use the loaded model to classify textresult = text_analytics_client.analyze_sentiment(text)return resultdef main():# Load the model20 unmodified lines212223242526272829303120 unmodified linesdef classify_text_azure(model, text):# Ensure input is in the correct format (list of strings)documents = [text] # Wrap the input string in a listresult = text_analytics_client.analyze_sentiment(documents=documents)return [{"id": i, "sentiment": doc.sentiment, "confidence_scores": doc.confidence_scores} for i, doc in enumerate(result)]def main():# Load the model
app.py+5-3