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
-
GGUF
Model size
4B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for p988744/eland-entity-sentiment-zh-gguf

Finetuned
Qwen/Qwen3-4B
Quantized
(210)
this model