Downloads · 30 days
0
theoracle/11italian-sent
11italian-sent is a machine learning model from theoracle. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as other.
Introducing the theoracle/11italian-sent model, a highly specialized tool designed for sentiment analysis in Italian. Built on the Gemma 2B architecture and fine-tuned with a diverse set of Italian texts, this model c…
Downloads · 30 days
0
Access
Public
Updated Mar 29, 2024
Repo size
257 MB
Likes
0
Public
Click a slice to open those files.
.pt157 MB · 44%
From the Hugging Face model README
Introducing the theoracle/11italian-sent model, a highly specialized tool designed for sentiment analysis in Italian. Built on the Gemma 2B architecture and fine-tuned with a diverse set of Italian texts, this model can accurately classify sentences into positive, neutral, or negative sentiments. Whether analyzing customer feedback, social media posts, or news headlines, this model offers deep insights into the emotional tone of Italian texts.
Here's how to utilize this model for sentiment analysis on Italian text:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = "theoracle/11italian-sent"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="auto",
torch_dtype='auto'
).eval()
# Prepare your hotel review or any Italian text
prompt = '''
Analyze the sentiment of the hotel review enclosed in square brackets, determine if it is positive, neutral, or negative, and return the answer as the corresponding sentiment label "positive" or "neutral" or "negative" [Inserisci qui la tua recensione dell'hotel]
'''
# Tokenize and generate the response
encoding = tokenizer(prompt, return_tensors='pt', padding=True, truncation=True, max_length=500, add_special_tokens=True)
input_ids = encoding['input_ids']
attention_mask = encoding['attention_mask']
output_ids = model.generate(
input_ids.to('cuda'),
attention_mask=attention_mask.to('cuda'),
max_new_tokens=300,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(response)
This model is invaluable for:
theoracle/11italian-sent is trained with AutoTrain, ensuring optimal training efficiency, and is built on the Gemma 2B architecture, known for its high performance in text generation and understanding tasks. The combination offers unparalleled accuracy and speed in processing Italian texts for sentiment analysis.
This model is available under an "other" license, suitable for both commercial and non-commercial use, though users are encouraged to review the license details for full compliance with their intended applications.