YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Mindcast SD_SC Pipeline

ํ•œ๊ตญ์–ด ํ…์ŠคํŠธ๋ฅผ ์œ„ํ•œ ํ†ตํ•ฉ ๊ฐ์ • ๋ถ„์„ ํŒŒ์ดํ”„๋ผ์ธ์ž…๋‹ˆ๋‹ค. Sarcasm Detection๊ณผ Sentiment Classification์„ ๊ฒฐํ•ฉํ•˜์—ฌ ๋” ์ •ํ™•ํ•œ ๊ฐ์ • ๋ถ„์„์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

๐Ÿš€ ํŠน์ง•

  • 2๋‹จ๊ณ„ ํŒŒ์ดํ”„๋ผ์ธ: Sarcasm Detection โ†’ Sentiment Classification
  • ์ƒํ™ฉ๋ณ„ ๋ชจ๋ธ ์‚ฌ์šฉ: ์ผ๋ฐ˜ ํ…์ŠคํŠธ์™€ ๋น„๊ผฌ๋Š” ํ…์ŠคํŠธ์— ๊ฐ๊ฐ ํŠนํ™”๋œ ๋ชจ๋ธ ์ ์šฉ
  • 6๊ฐ€์ง€ ๊ฐ์ • ๋ถ„๋ฅ˜: ๋ถ„๋…ธ, ์Šฌํ””, ๋ถˆ์•ˆ, ์ƒ์ฒ˜, ๋‹นํ™ฉ, ๊ธฐ์จ
  • ๋ฐฐ์น˜ ์ฒ˜๋ฆฌ ์ง€์›: ์—ฌ๋Ÿฌ ํ…์ŠคํŠธ ๋™์‹œ ๋ถ„์„
  • ๋ถ„ํฌ ๋ถ„์„ ๊ธฐ๋Šฅ: ๊ฐ์ • ๋ฐ sarcasm ๋ถ„ํฌ ํ†ต๊ณ„

๐Ÿ“‹ ์›Œํฌํ”Œ๋กœ์šฐ

  1. ์ž…๋ ฅ ํ…์ŠคํŠธ โ†’ Sarcasm Detector โ†’ Normal(0) or Sarcastic(1)
  2. Normal โ†’ SC_Normal ๋ชจ๋ธ๋กœ ๊ฐ์ • ๋ถ„๋ฅ˜
  3. Sarcastic โ†’ SC_Sarcastic ๋ชจ๋ธ๋กœ ๊ฐ์ • ๋ถ„๋ฅ˜
  4. ์ตœ์ข… ๊ฐ์ • ๊ฒฐ๊ณผ ๋ฐ˜ํ™˜

๐Ÿ”ง ์„ค์น˜

pip install torch transformers huggingface_hub numpy

๐Ÿ’ป ์‚ฌ์šฉ๋ฒ•

๊ธฐ๋ณธ ์‚ฌ์šฉ

from sd_sc_pipeline import load_mindcast_pipeline

# ํŒŒ์ดํ”„๋ผ์ธ ๋กœ๋“œ
pipeline = load_mindcast_pipeline()

# ๋‹จ์ผ ํ…์ŠคํŠธ ๋ถ„์„
text = "์•„ ์ง„์งœ ์ตœ๊ณ ๋‹ค~ ์™„์ „ ๋งํ–ˆ๋„ค"
result = pipeline.predict(text)

print(f"ํ…์ŠคํŠธ: {text}")
print(f"Sarcasm: {result['sarcasm']['label']} ({result['sarcasm']['confidence']:.3f})")
print(f"๊ฐ์ •: {result['final_emotion']} ({result['sentiment']['confidence']:.3f})")
print(f"์‚ฌ์šฉ ๋ชจ๋ธ: {result['sentiment']['model_used']}")

๋ฐฐ์น˜ ๋ถ„์„

texts = [
    "์˜ค๋Š˜ ์ •๋ง ๊ธฐ๋ถ„์ด ์ข‹์•„์š”!",
    "์•„ ์ง„์งœ ์ตœ๊ณ ๋‹ค~ ์™„์ „ ๋งํ–ˆ๋„ค", 
    "๋„ˆ๋ฌด ์Šฌํผ์„œ ๋ˆˆ๋ฌผ์ด ๋‚˜์š”"
]

# ๋ฐฐ์น˜ ์˜ˆ์ธก
results = pipeline.predict_batch(texts)

# ๊ฐ์ • ๋ถ„ํฌ ๋ถ„์„
emotion_dist = pipeline.get_emotion_distribution(texts)
print("๊ฐ์ • ๋ถ„ํฌ:", emotion_dist)

# Sarcasm ๋ถ„ํฌ ๋ถ„์„  
sarcasm_dist = pipeline.analyze_sarcasm_distribution(texts)
print(f"Sarcastic ๋น„์œจ: {sarcasm_dist['sarcastic_ratio']:.1%}")

๋น ๋ฅธ ์‚ฌ์šฉ (Quick API)

from sd_sc_pipeline import quick_predict

emotion = quick_predict("์™€~ ์ •๋ง ๋Œ€๋‹จํ•˜๋„ค์š”~")
print(emotion)  # ์ถœ๋ ฅ: "๋ถ„๋…ธ" (sarcastic context์—์„œ ๋ถ„์„๋จ)

๐Ÿค– ์‚ฌ์šฉ๋œ ๋ชจ๋ธ

  • Sarcasm Detector: merrybabyxmas/mindcast-sarcasm-detector
  • Normal Sentiment: merrybabyxmas/mindcast-emotion-normal
  • Sarcastic Sentiment: merrybabyxmas/mindcast-emotion-sarcastic

๐Ÿ“Š ๊ฐ์ • ๋ผ๋ฒจ

ID ๊ฐ์ • ์„ค๋ช…
0 ๋ถ„๋…ธ ํ™”๋‚จ, ์งœ์ฆ, ๋ถˆ์พŒ๊ฐ
1 ์Šฌํ”” ์šฐ์šธ, ์‹ค๋ง, ์ขŒ์ ˆ๊ฐ
2 ๋ถˆ์•ˆ ๊ฑฑ์ •, ๋‘๋ ค์›€, ๊ธด์žฅ๊ฐ
3 ์ƒ์ฒ˜ ์„œ์šดํ•จ, ๋ฐฐ์‹ ๊ฐ, ์•„ํ””
4 ๋‹นํ™ฉ ๋†€๋žŒ, ํ˜ผ๋ž€, ์–ด๋ฆฌ๋‘ฅ์ ˆ
5 ๊ธฐ์จ ํ–‰๋ณต, ๋งŒ์กฑ, ์ฆ๊ฑฐ์›€

โšก ์„ฑ๋Šฅ ์ตœ์ ํ™”

# GPU ์‚ฌ์šฉ
pipeline = load_mindcast_pipeline(device="cuda")

# ํŠน์ • GPU ์‚ฌ์šฉ
pipeline = load_mindcast_pipeline(device="cuda:0") 

# CPU ์‚ฌ์šฉ
pipeline = load_mindcast_pipeline(device="cpu")

๐Ÿ“ ํŒŒ์ผ ๊ตฌ์กฐ

โ”œโ”€โ”€ sd_sc_pipeline.py     # ๋ฉ”์ธ ํŒŒ์ดํ”„๋ผ์ธ ํด๋ž˜์Šค
โ”œโ”€โ”€ __init__.py           # ํŒจํ‚ค์ง€ ์ดˆ๊ธฐํ™”
โ”œโ”€โ”€ example.py            # ์‚ฌ์šฉ ์˜ˆ์ œ
โ”œโ”€โ”€ pipeline_config.json  # ์„ค์ • ํŒŒ์ผ
โ”œโ”€โ”€ requirements.txt      # ์˜์กด์„ฑ ๋ชฉ๋ก
โ””โ”€โ”€ README.md            # ์ด ๋ฌธ์„œ

๐Ÿ” ์˜ˆ์ œ ๊ฒฐ๊ณผ

ํ…์ŠคํŠธ: ์•„ ์ง„์งœ ์ตœ๊ณ ๋‹ค~ ์™„์ „ ๋งํ–ˆ๋„ค
Sarcasm: Sarcastic (0.892)
๊ฐ์ •: ๋ถ„๋…ธ (sarcastic model, 0.856)

ํ…์ŠคํŠธ: ์˜ค๋Š˜ ์ •๋ง ๊ธฐ๋ถ„์ด ์ข‹์•„์š”!
Sarcasm: Non-sarcastic (0.934) 
๊ฐ์ •: ๊ธฐ์จ (normal model, 0.912)

๐Ÿท๏ธ ๋ผ์ด์„ผ์Šค

์ด ํŒŒ์ดํ”„๋ผ์ธ์€ ์—ฐ๊ตฌ ๋ฐ ๋น„์ƒ์—…์  ์šฉ๋„๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

๐Ÿค ๊ธฐ์—ฌ

๋ฒ„๊ทธ ๋ฆฌํฌํŠธ๋‚˜ ๊ฐœ์„  ์ œ์•ˆ์€ Issues์—์„œ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค!


Mindcast Team | ํ•œ๊ตญ์–ด ๊ฐ์ • ๋ถ„์„์˜ ์ƒˆ๋กœ์šด ๊ธฐ์ค€

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support