Eland Entity Sentiment GGUF - Chinese Entity-Level Sentiment Analysis
GGUF quantized version of the Eland Entity Sentiment model for Ollama and llama.cpp deployment.
Available Files
| File | Size | Quantization | Use Case |
|---|---|---|---|
eland-entity-sentiment-zh-q8_0.gguf |
4.0 GB | Q8_0 | Recommended - Best balance of size and quality |
Performance
| Metric | Score |
|---|---|
| Accuracy | 72.00% |
| Macro-F1 | 70.80% |
Per-Class Performance
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| ๆญฃ้ข (Positive) | 86% | 78% | 82% |
| ่ฒ ้ข (Negative) | 94% | 62% | 74% |
| ไธญ็ซ (Neutral) | 46% | 72% | 56% |
Ollama: No System Prompt Required
ไฝฟ็จ Ollama ๆไธ้่ฆ้กๅคๆไพ System Prompt๏ผModelfile ๅทฒๅ งๅปบใ
็ดๆฅ่ผธๅ ฅๅฏฆ้ซๅๆๆฌๅณๅฏ๏ผ
ollama run eland-entity-sentiment-zh "ๅๆไปฅไธๆๆฌๅฐใๅฐ็ฉ้ปใ็ๆ
ๆๅพๅใ
ๆๆฌ๏ผๅฐ็ฉ้ป็ๆถๅตๆฐ้ซ๏ผๅธๅ ด็ๅฅฝAI้ๆฑๆ็บๆ้ทใ
่ซไปฅ JSON ๆ ผๅผๅ็ญ๏ผๅ
ๅซ entity_sentiment๏ผๅฏฆ้ซๆ
ๆ๏ผใ"
# ่ผธๅบ๏ผ{"entity_sentiment": "ๆญฃ้ข"}
ๅฆๆไฝฟ็จ vLLM ๆ Transformers๏ผ่ซๅ่ vLLM ็ๆฌ ็ System Prompt ่ชชๆใ
Usage with Ollama
Quick Start
# Download GGUF and Modelfile
wget https://huggingface.co/p988744/eland-entity-sentiment-zh-gguf/resolve/main/eland-entity-sentiment-zh-q8_0.gguf
wget https://huggingface.co/p988744/eland-entity-sentiment-zh-gguf/resolve/main/Modelfile
# Create Ollama model
ollama create eland-entity-sentiment-zh -f Modelfile
# Run inference
ollama run eland-entity-sentiment-zh "ๅๆไปฅไธๆๆฌๅฐใๅฐ็ฉ้ปใ็ๆ
ๆๅพๅใ
ๆๆฌ๏ผๅฐ็ฉ้ป็ๆถๅตๆฐ้ซ๏ผๅธๅ ด็ๅฅฝAI้ๆฑๆ็บๆ้ทใ
่ซไปฅ JSON ๆ ผๅผๅ็ญ๏ผๅ
ๅซ entity_sentiment๏ผๅฏฆ้ซๆ
ๆ๏ผใ"
Custom Modelfile
The included Modelfile is configured for entity sentiment analysis:
FROM ./eland-entity-sentiment-zh-q8_0.gguf
TEMPLATE """{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
<think>
</think>
"""
SYSTEM """ไฝ ๆฏไธๅๅฐๆฅญ็ๅฏฆ้ซๆ
ๆๅๆๅฉๆใไฝ ็ไปปๅๆฏๅๆๆๆฌไธญๅฐๆๅฎๅฏฆ้ซ๏ผๅ็ใ็ขๅใๅ
ฌๅธใไบบ็ฉ๏ผ็ๆ
ๆๅพๅใ
่ฆๅ๏ผ
1. ๆ
ๆๅช่ฝๆฏ๏ผๆญฃ้ขใ่ฒ ้ขใไธญ็ซ
2. ๅชๅๆๅฐ่ฉฒๆๅฎๅฏฆ้ซ็ๆ
ๆ๏ผๅฟฝ็ฅๅ
ถไปๅฏฆ้ซ
3. ๅไธๆๆฌๅฏ่ฝๅฐไธๅๅฏฆ้ซๆไธๅๆ
ๆ
4. ๅคๆท็ๅฏฆๆๅ๏ผๆณจๆ่ซทๅบๅ้ฑๅซๆๆ
5. ๅ็ญๆ ผๅผๅฟ
้ ๆฏ JSON"""
PARAMETER temperature 0.1
PARAMETER num_predict 50
PARAMETER stop "<|im_end|>"
API Usage
# Start Ollama server (if not running)
ollama serve
# Query via API
curl http://localhost:11434/api/generate -d '{
"model": "eland-entity-sentiment-zh",
"prompt": "ๅๆไปฅไธๆๆฌๅฐใๅฐ็ฉ้ปใ็ๆ
ๆๅพๅใ\n\nๆๆฌ๏ผๅฐ็ฉ้ป็ๆถๅตๆฐ้ซ\n\n่ซไปฅ JSON ๆ ผๅผๅ็ญ๏ผๅ
ๅซ entity_sentiment๏ผๅฏฆ้ซๆ
ๆ๏ผใ",
"stream": false
}'
Python with Ollama
import ollama
response = ollama.generate(
model='eland-entity-sentiment-zh',
prompt='ๅๆไปฅไธๆๆฌๅฐใๅฐ็ฉ้ปใ็ๆ
ๆๅพๅใ\n\nๆๆฌ๏ผๅฐ็ฉ้ป็ๆถๅตๆฐ้ซ๏ผๅธๅ ด็ๅฅฝAI้ๆฑๆ็บๆ้ทใ\n\n่ซไปฅ JSON ๆ ผๅผๅ็ญ๏ผๅ
ๅซ entity_sentiment๏ผๅฏฆ้ซๆ
ๆ๏ผใ'
)
print(response['response']) # Expected: {"entity_sentiment": "ๆญฃ้ข"}
Usage with llama.cpp
CLI
# Download GGUF
wget https://huggingface.co/p988744/eland-entity-sentiment-zh-gguf/resolve/main/eland-entity-sentiment-zh-q8_0.gguf
# Run inference
./llama-cli -m eland-entity-sentiment-zh-q8_0.gguf \
-p "<|im_start|>system
ไฝ ๆฏไธๅๅฐๆฅญ็ๅฏฆ้ซๆ
ๆๅๆๅฉๆใไฝ ็ไปปๅๆฏๅๆๆๆฌไธญๅฐๆๅฎๅฏฆ้ซ็ๆ
ๆๅพๅใ<|im_end|>
<|im_start|>user
ๅๆไปฅไธๆๆฌๅฐใๅฐ็ฉ้ปใ็ๆ
ๆๅพๅใ
ๆๆฌ๏ผๅฐ็ฉ้ป็ๆถๅตๆฐ้ซ
่ซไปฅ JSON ๆ ผๅผๅ็ญ๏ผๅ
ๅซ entity_sentiment๏ผๅฏฆ้ซๆ
ๆ๏ผใ<|im_end|>
<|im_start|>assistant
" \
-n 50 \
--temp 0.1
llama-cpp-python
from llama_cpp import Llama
llm = Llama(
model_path="eland-entity-sentiment-zh-q8_0.gguf",
n_ctx=2048,
n_threads=4
)
prompt = """<|im_start|>system
ไฝ ๆฏไธๅๅฐๆฅญ็ๅฏฆ้ซๆ
ๆๅๆๅฉๆใไฝ ็ไปปๅๆฏๅๆๆๆฌไธญๅฐๆๅฎๅฏฆ้ซ็ๆ
ๆๅพๅใ<|im_end|>
<|im_start|>user
ๅๆไปฅไธๆๆฌๅฐใๅฐ็ฉ้ปใ็ๆ
ๆๅพๅใ
ๆๆฌ๏ผๅฐ็ฉ้ป็ๆถๅตๆฐ้ซ๏ผๅธๅ ด็ๅฅฝAI้ๆฑๆ็บๆ้ทใ
่ซไปฅ JSON ๆ ผๅผๅ็ญ๏ผๅ
ๅซ entity_sentiment๏ผๅฏฆ้ซๆ
ๆ๏ผใ<|im_end|>
<|im_start|>assistant
"""
output = llm(prompt, max_tokens=50, temperature=0.1)
print(output['choices'][0]['text']) # Expected: {"entity_sentiment": "ๆญฃ้ข"}
Prompt Format
User: ๅๆไปฅไธๆๆฌๅฐใ{entity}ใ็ๆ
ๆๅพๅใ
ๆๆฌ๏ผ{text}
่ซไปฅ JSON ๆ ผๅผๅ็ญ๏ผๅ
ๅซ entity_sentiment๏ผๅฏฆ้ซๆ
ๆ๏ผใ
Model Variants
| Version | Repository | Use Case |
|---|---|---|
| LoRA Adapter | p988744/eland-entity-sentiment-zh | HuggingFace + PEFT |
| GGUF | p988744/eland-entity-sentiment-zh-gguf | Ollama / llama.cpp (this repo) |
| Full Merged | p988744/eland-entity-sentiment-zh-vllm | vLLM |
Model Details
| Parameter | Value |
|---|---|
| Base Model | Qwen/Qwen3-4B |
| Parameters | 4.05B |
| Tensors | 398 |
| Context Length | 2048 |
Dataset
Trained on p988744/eland-entity-sentiment-zh-data:
- Training: 333 samples
- Test: 100 samples
License
Apache 2.0
- Downloads last month
- -
Hardware compatibility
Log In to add your hardware
8-bit