Downloads · 30 days
22
8% of all-time downloads
Alpaca69B/phi2-2b-absa
phi2-2b-absa is a text generation model from Alpaca69B. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
22
8% of all-time downloads
All-time downloads
264
Public
Parameters
2.8B
5.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.6 GB · 100%
From the Hugging Face model README
The phi2-2b-absa model is a fine-tuned aspect-based sentiment analysis (ABSA) model based on the Microsoft Phi-2 model. It has been trained on the semeval2016-full-absa-reviews-english-translated-resampled dataset. The model predicts sentiments towards different aspects mentioned in a given sentence.
The fine tuning can be revisited on Google Colab.
from transformers import AutoTokenizer, pipeline
import torch
model = "Alpaca69B/llama-2-7b-absa-semeval-2016"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.float16,
device="auto",
)
input_sentence = "the first thing that attracts attention is the warm reception and the smiling receptionists."
sequences = pipeline(
f'### Human: {input_sentence} ### Assistant: aspect:',
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
max_length=200,
)
sequences[0]['generated_text']
Testing can be seen on Google Colab