Spaces:
Runtime error
Runtime error
| from transformers import pipeline | |
| import streamlit as st | |
| # Load the classification pipeline with the specified model | |
| pipe = pipeline("text-classification", model="tabularisai/multilingual-sentiment-analysis") | |
| st.title("sentiment analysis model") | |
| user_input = st.text_area('Enter Text: ') | |
| if user_input: | |
| result = pipe(user_input)[0] | |
| st.write(f"sentiment : {result['label']}") | |
| # Classify a new sentence | |
| sentence = "I love this product! It's amazing and works perfectly." | |
| result = pipe(sentence) | |
| # Print the result | |
| print(result) | |