Text Classification
Transformers
ONNX
Safetensors
English
bert
financial-sentiment
finance
sentiment-analysis
minilm
Eval Results (legacy)
text-embeddings-inference
Instructions to use 9mark9/finbert-minilm-sentiment with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 9mark9/finbert-minilm-sentiment with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="9mark9/finbert-minilm-sentiment")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("9mark9/finbert-minilm-sentiment") model = AutoModelForSequenceClassification.from_pretrained("9mark9/finbert-minilm-sentiment", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download eval_model.py from 9mark9/finbert-minilm-sentiment: direct link, hf CLI and curl.
- Browser
- Download file 591 Bytes
-
https://huggingface.co/9mark9/finbert-minilm-sentiment/resolve/main/eval_model.py
- Command line
-
hf download hf://9mark9/finbert-minilm-sentiment/eval_model.py
-
curl -L -o eval_model.py https://huggingface.co/9mark9/finbert-minilm-sentiment/resolve/main/eval_model.py
591 Bytes
| """Usage: eval_model.py <model id or dir> [revision] [out.json] — scores all three held-out sets.""" | |
| import sys, json | |
| from transformers import AutoModelForSequenceClassification, AutoTokenizer | |
| from common import evaluate, fmt, device | |
| src = sys.argv[1] | |
| rev = sys.argv[2] if len(sys.argv) > 2 and sys.argv[2] != "-" else None | |
| tok = AutoTokenizer.from_pretrained(src, revision=rev) | |
| model = AutoModelForSequenceClassification.from_pretrained(src, revision=rev).to(device()) | |
| res = evaluate(model, tok) | |
| print(fmt(res)) | |
| if len(sys.argv) > 3: | |
| json.dump(res, open(sys.argv[3], "w"), indent=1) | |