takala/financial_phrasebank
Updated • 7.15k • 259
How to use winddude/mamba_finacial_phrasebank_sentiment with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="winddude/mamba_finacial_phrasebank_sentiment", trust_remote_code=True) # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("winddude/mamba_finacial_phrasebank_sentiment", trust_remote_code=True)
model = AutoModelForSequenceClassification.from_pretrained("winddude/mamba_finacial_phrasebank_sentiment", trust_remote_code=True)Score 0.84 on accuracy for the finacial phrasebank dataset. A completely huggingface capitable implementation of sequence classification with mamba using: https://github.com/getorca/mamba_for_sequence_classification.
from transformers import pipeline
model_path = 'winddude/mamba_finacial_phrasebank_sentiment'
classifier = pipeline("text-classification", model=model_path, trust_remote_code=True)
text = "Finnish retail software developer Aldata Solution Oyj reported a net loss of 11.7 mln euro $ 17.2 mln for 2007 versus a net profit of 2.5 mln euro $ 3.7 mln for 2006 ."
classifier(text)
gives:
[{'label': 'NEGATIVE', 'score': 0.8793253302574158}]