Instructions to use achen0525/DistilBERT_FOMC_Classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use achen0525/DistilBERT_FOMC_Classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="achen0525/DistilBERT_FOMC_Classifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("achen0525/DistilBERT_FOMC_Classifier") model = AutoModelForSequenceClassification.from_pretrained("achen0525/DistilBERT_FOMC_Classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| library_name: transformers | |
| license: apache-2.0 | |
| datasets: | |
| - gtfintechlab/fomc_communication | |
| - Sorour/fomc | |
| language: | |
| - en | |
| metrics: | |
| - accuracy | |
| base_model: | |
| - distilbert/distilbert-base-uncased | |
| pipeline_tag: text-classification | |
| # Model Card for Model ID | |
| <!-- Provide a quick summary of what the model is/does. --> | |
| Fine-Tuned Transformer for FOMC Sentiment Classification | |
| ## Model Details | |
| ### Model Description | |
| <!-- Provide a longer summary of what this model is. --> | |
| This model is a fine-tuned version of [DistilBERT](https://huggingface.co/distilbert-base-uncased) for **FOMC meeting sentiment classification**. It predicts whether a sentence from U.S. Federal Open Market Committee (FOMC) statements is **Dovish**, **Hawkish**, or **Neutral**. | |
| - **Developed by:** [Ao Chen] | |
| - **Model type:** [Encoder-only Transformer (DistilBERT)] | |
| - **Language(s) (NLP):** [en] | |
| - **License:** [Apache 2.0] | |
| - **Finetuned from model [optional]:** [distilbert-base-uncased] | |
| ## Uses | |
| <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. --> | |
| ### Direct Use | |
| <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. --> | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForSequenceClassification | |
| import torch | |
| model_name = "achen0525/DistilBERT_FOMC_Classifier" | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| model = AutoModelForSequenceClassification.from_pretrained(model_name) | |
| text = "The Committee decided to maintain the target range for the federal funds rate." | |
| inputs = tokenizer(text, return_tensors="pt") | |
| outputs = model(**inputs) | |
| pred = torch.argmax(outputs.logits, dim=1) | |
| labels = ['Dovish', 'Hawkish', 'Neutral'] | |
| print(labels[pred.item()]) | |
| ``` | |
| ## Model Card Contact | |
| For questions or feedback, reach out to: aochen@bu.edu | |