Instructions to use Proooof/Finance_NLP_Toolkit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Proooof/Finance_NLP_Toolkit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Proooof/Finance_NLP_Toolkit")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Proooof/Finance_NLP_Toolkit", dtype="auto") - Notebooks
- Google Colab
- Kaggle
File size: 726 Bytes
df657b3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | from transformers import pipeline, AutoTokenizer, AutoModelForTokenClassification
def demo_sentiment():
clf = pipeline("sentiment-analysis", model="YOUR-USERNAME/Finance-NLP-Toolkit")
print(clf("Shares plunged after the weak revenue outlook."))
def demo_ner():
tok = AutoTokenizer.from_pretrained("YOUR-USERNAME/Finance-NLP-Toolkit", revision="ner")
ner_model = AutoModelForTokenClassification.from_pretrained("YOUR-USERNAME/Finance-NLP-Toolkit", revision="ner")
ner = pipeline("token-classification", model=ner_model, tokenizer=tok, aggregation_strategy="simple")
print(ner("Microsoft will acquire Nuance for $19.7 billion in 2025."))
if __name__ == "__main__":
demo_sentiment()
demo_ner()
|