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
| 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() | |