Downloads · 30 days
4
31% of all-time downloads
kienhoang123/Poem_Analysis_Instruct_VN
Poem_Analysis_Instruct_VN is a machine learning model from kienhoang123. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
--- language: vi license: apache-2.0 tags: - vietnamese - poem-analysis - instruction-tuned - flan-t5 datasets: - kienhoang123/VietnamesePoemAnalysisVN ---
Downloads · 30 days
4
31% of all-time downloads
All-time downloads
13
Public
Parameters
77M
616 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors308 MB · 99%
From the Hugging Face model README
language: vi
license: apache-2.0
tags:
- vietnamese
- poem-analysis
- instruction-tuned
- flan-t5
datasets:
- kienhoang123/Vietnamese_Poem_Analysis_VN
---
# Instruction-Tuned T5 Model for Vietnamese Poem Analysis
This model was fine-tuned on kienhoang123/Vietnamese_Poem_Analysis_VN to analyze Vietnamese poetry using an instruction-based approach.
## Model Details
- **Base Model**: google/flan-t5-small
- **Training Data**: Vietnamese poem analysis dataset
- **Tasks**: Extract emotion, metaphor, setting, motion, and prompt from Vietnamese poems
## Usage
```python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("kienhoang123/Poem_Analysis_Instruct_VN")
model = AutoModelForSeq2SeqLM.from_pretrained("kienhoang123/Poem_Analysis_Instruct_VN")
# Create an instruction-based input
instruction = '''
Below is an instruction that describes a task.
### Instruction:
Generate emotion, metaphor, setting, motion and prompt in Vietnamese for the following content.
### Input:
Your Vietnamese poem here
### Output:
'''
inputs = tokenizer(instruction, return_tensors="pt")
outputs = model.generate(**inputs, max_length=150)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)
```
The output is formatted as: "emotion ||| metaphor ||| setting ||| motion ||| prompt"