Llama-3.1-8B-Instruct-Mental-Health-Classification
kingabzpro
Pregunta y respuesta
Este modelo es una versión ajustada de meta-llama/Meta-Llama-3.1-8B-Instruct en un conjunto de datos suchintikasarkar/sentiment-analysis-for-mental-health. Este modelo puede predecir varios trastornos de salud mental a partir del texto.
Como usar
from transformers import AutoTokenizer,AutoModelForCausalLM,pipeline
import torch
model_id = "kingabzpro/Llama-3.1-8B-Instruct-Mental-Health-Classification"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
return_dict=True,
low_cpu_mem_usage=True,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
)
text = "I'm trapped in a storm of emotions that I can't control, and it feels like no one understands the chaos inside me"
prompt = f"""Classify the text into Normal, Depression, Anxiety, Bipolar, and return the answer as the corresponding mental health disorder label.
text: {text}
label: """.strip()
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.float16,
device_map="auto",
)
outputs = pipe(prompt, max_new_tokens=2, do_sample=True, temperature=0.1)
print(outputs[0]["generated_text"].split("label: ")[-1].strip())
# Depression
Funcionalidades
- Transformers
- Safetensors
- Generación de texto
- Clasificación de salud mental
- Compatible con AutoTrain
- Inferencias de generación de texto
- Compatible con Endpoints
Casos de uso
- Clasificación de trastornos de salud mental
- Predicción de etiquetas de salud mental a partir de texto
- Generación de respuestas a preguntas relacionadas con la salud mental