Run this model with HF Jobs
Run blanchefort/rubert-base-cased-sentiment-med on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/blanchefort/rubert-base-cased-sentiment-med. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/blanchefort/rubert-base-cased-sentiment-med on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use blanchefort/rubert-base-cased-sentiment-med with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use blanchefort/rubert-base-cased-sentiment-med with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="blanchefort/rubert-base-cased-sentiment-med")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("blanchefort/rubert-base-cased-sentiment-med") model = AutoModelForSequenceClassification.from_pretrained("blanchefort/rubert-base-cased-sentiment-med", device_map="auto") - Notebooks
- Google Colab
- Kaggle
RuBERT for Sentiment Analysis of Medical Reviews
This is a DeepPavlov/rubert-base-cased-conversational model trained on corpus of medical reviews.
Labels
0: NEUTRAL
1: POSITIVE
2: NEGATIVE
How to use
import torch
from transformers import AutoModelForSequenceClassification
from transformers import BertTokenizerFast
tokenizer = BertTokenizerFast.from_pretrained('blanchefort/rubert-base-cased-sentiment-med')
model = AutoModelForSequenceClassification.from_pretrained('blanchefort/rubert-base-cased-sentiment-med', return_dict=True)
@torch.no_grad()
def predict(text):
inputs = tokenizer(text, max_length=512, padding=True, truncation=True, return_tensors='pt')
outputs = model(**inputs)
predicted = torch.nn.functional.softmax(outputs.logits, dim=1)
predicted = torch.argmax(predicted, dim=1).numpy()
return predicted
Dataset used for model training
Датасет содержит пользовательские отзывы о медицинских учреждениях. Датасет собран в мае 2019 года с сайта prodoctorov.ru
- Downloads last month
- 31