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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
- Text Classification
|
11 |
- bert
|
12 |
- Inference Endpoints
|
13 |
+
---
|
14 |
+
# Model Card for Model ID
|
15 |
+
|
16 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
17 |
+
|
18 |
+
Our fine-tuned FinBERT model is a powerful tool designed for sentiment analysis specifically tailored to Indian stock market news. Leveraging the foundation of FinBERT, a BERT model pre-trained on extensive financial communication text (https://huggingface.co/yiyanghkust/finbert-tone) , our model focuses on enhancing sentiment analysis within the context of the Indian financial landscape.
|
19 |
+
|
20 |
+
## Model Details
|
21 |
+
|
22 |
+
### Model Description
|
23 |
+
|
24 |
+
<!-- Provide a longer summary of what this model is. -->
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
- **Developed by:** Khushi Dave
|
29 |
+
- **Funded by [optional]:** [More Information Needed]
|
30 |
+
- **Shared by [optional]:** [More Information Needed]
|
31 |
+
- **Model type:** [More Information Needed]
|
32 |
+
- **Language(s) (NLP):** English
|
33 |
+
- **License:** [More Information Needed]
|
34 |
+
- **Finetuned from model [optional]:** yiyanghkust/finbert-tone
|
35 |
+
|
36 |
+
### Model Sources [optional]
|
37 |
+
|
38 |
+
<!-- Provide the basic links for the model. -->
|
39 |
+
|
40 |
+
- **Repository:** https://huggingface.co/kdave/FineTuned_Finbert
|
41 |
+
- **Paper [optional]:** [More Information Needed]
|
42 |
+
- **Demo [optional]:** [More Information Needed]
|
43 |
+
|
44 |
+
## Uses
|
45 |
+
|
46 |
+
The Fine-Tuned FinBERT model is designed for sentiment analysis in Indian stock market news. It's beneficial for researchers, financial analysts, and developers aiming to enhance sentiment assessments. Users include those making investment decisions and the academic community. Responsible usage and acknowledgment of the original FinBERT model are encouraged.
|
47 |
+
|
48 |
+
In essence, it's a valuable tool for understanding market sentiment in the Indian context, catering to professionals and individuals engaged in financial analysis and research.
|
49 |
+
|
50 |
+
### Direct Use
|
51 |
+
|
52 |
+
```python
|
53 |
+
from transformers import BertTokenizer, BertForSequenceClassification
|
54 |
+
from transformers import pipeline
|
55 |
+
|
56 |
+
# Load the fine-tuned FinBERT model and tokenizer
|
57 |
+
finbert = BertForSequenceClassification.from_pretrained('kdave/FineTuned_Finbert, num_labels=3)
|
58 |
+
tokenizer = BertTokenizer.from_pretrained('kdave/FineTuned_Finbert')
|
59 |
+
|
60 |
+
# Create a sentiment-analysis pipeline
|
61 |
+
nlp_pipeline = pipeline("sentiment-analysis", model = finbert, tokenizer = tokenizer)
|
62 |
+
|
63 |
+
# Example sentences related to Indian stock market news
|
64 |
+
sentences = [
|
65 |
+
"The Indian stock market experienced a surge in trading activity.",
|
66 |
+
"Investors are optimistic about the future of Indian financial markets.",
|
67 |
+
"Concerns about economic uncertainties are affecting stock prices in India.",
|
68 |
+
"Earnings reports from Indian companies show a positive trend."
|
69 |
+
]
|
70 |
+
|
71 |
+
# Perform sentiment analysis using the fine-tuned FinBERT model for Indian stock market news
|
72 |
+
results = nlp_pipeline(sentences)
|
73 |
+
print(results)
|
74 |
+
```
|
75 |
+
|
76 |
+
[More Information Needed]
|
77 |
+
|
78 |
+
### Downstream Use [optional]
|
79 |
+
|
80 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
81 |
+
|
82 |
+
[More Information Needed]
|
83 |
+
|
84 |
+
### Out-of-Scope Use
|
85 |
+
|
86 |
+
1. Misuse:
|
87 |
+
Deliberate Misinformation: The model may be misused if fed with intentionally crafted misinformation to manipulate sentiment analysis results. Users should ensure the input data is authentic and unbiased.
|
88 |
+
|
89 |
+
2. Malicious Use:
|
90 |
+
Market Manipulation Attempts: Any attempt to use the model to propagate false sentiment for the purpose of market manipulation is strictly unethical and against the intended use of the model.
|
91 |
+
|
92 |
+
3. Limitations:
|
93 |
+
Non-Financial Texts: The model is fine-tuned specifically for Indian stock market news. It may not perform optimally when applied to non-financial texts or unrelated domains.
|
94 |
+
Extreme Outliers: Unusual or extreme cases in sentiment expression might pose challenges. The model's performance might be less reliable for exceptionally rare or unconventional sentiment expressions.
|
95 |
+
Non-Standard Language: The model's training data primarily comprises standard financial language. It may not perform as well when faced with non-standard language, colloquialisms, or slang.
|
96 |
+
|
97 |
+
[More Information Needed]
|
98 |
+
|
99 |
+
## Bias, Risks, and Limitations
|
100 |
+
|
101 |
+
#### Technical Limitations:
|
102 |
+
|
103 |
+
1. **Domain Specificity:**
|
104 |
+
- The model is finely tuned for Indian stock market news, limiting its effectiveness when applied to texts outside this domain.
|
105 |
+
|
106 |
+
2. **Data Representativeness:**
|
107 |
+
- The model's performance is contingent on the representativeness of the training data. It may not capture nuances in sentiment expressions not well-represented in the training corpus.
|
108 |
+
|
109 |
+
3. **Language Complexity:**
|
110 |
+
- Non-standard language, colloquialisms, or slang may pose challenges, as the model is primarily trained on standard financial language.
|
111 |
+
|
112 |
+
#### Sociotechnical Considerations:
|
113 |
+
|
114 |
+
1. **Bias in Training Data:**
|
115 |
+
- The model inherits biases present in the training data. Efforts have been made to curate diverse data, but biases, if present, may affect the model's outputs.
|
116 |
+
|
117 |
+
2. **Ethical Usage:**
|
118 |
+
- Users are urged to employ the model ethically, avoiding misuse or malicious applications that may impact market sentiment or manipulate results.
|
119 |
+
|
120 |
+
#### Risks:
|
121 |
+
|
122 |
+
1. **Decisions Based Solely on Model Output:**
|
123 |
+
- Relying solely on the model for decision-making is discouraged. Users should supplement model insights with additional research and expert judgment.
|
124 |
+
|
125 |
+
2. **Market Dynamics:**
|
126 |
+
- The model might not account for sudden and unprecedented market events, and decisions should consider real-time market dynamics.
|
127 |
+
|
128 |
+
### Responsible Model Usage:
|
129 |
+
|
130 |
+
Understanding these limitations, users are advised to interpret model outputs judiciously, considering the context and potential biases. Transparent communication and awareness of both technical and sociotechnical constraints are essential for responsible model usage. While the model is a valuable tool, it is not infallible, and decision-makers should exercise prudence and diligence.
|
131 |
+
|
132 |
+
[More Information Needed]
|
133 |
+
|
134 |
+
### Recommendations
|
135 |
+
|
136 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
137 |
+
|
138 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
139 |
+
|
140 |
+
## How to Get Started with the Model
|
141 |
+
|
142 |
+
Use the code below to get started with the model.
|
143 |
+
|
144 |
+
Step 1: Install Required Libraries
|
145 |
+
Ensure you have the necessary libraries installed by running:
|
146 |
+
|
147 |
+
```python
|
148 |
+
pip install transformers
|
149 |
+
```
|
150 |
+
|
151 |
+
Step 2: Load the Fine-Tuned Model
|
152 |
+
Use the following Python code to load the model and tokenizer:
|
153 |
+
|
154 |
+
```python
|
155 |
+
from transformers import BertTokenizer, BertForSequenceClassification
|
156 |
+
from transformers import pipeline
|
157 |
+
|
158 |
+
# Load the fine-tuned FinBERT model and tokenizer
|
159 |
+
finbert = BertForSequenceClassification.from_pretrained('kdave/FineTuned_Finbert', num_labels=3)
|
160 |
+
tokenizer = BertTokenizer.from_pretrained('kdave/FineTuned_Finbert')
|
161 |
+
|
162 |
+
# Create a sentiment-analysis pipeline
|
163 |
+
nlp_pipeline = pipeline("sentiment-analysis", model=finbert, tokenizer=tokenizer)
|
164 |
+
Step 3: Perform Sentiment Analysis
|
165 |
+
Now, you're ready to analyze sentiment! Provide the model with sentences related to Indian stock market news:
|
166 |
+
|
167 |
+
python
|
168 |
+
Copy code
|
169 |
+
# Example sentences related to Indian stock market news
|
170 |
+
sentences = [
|
171 |
+
"The Indian stock market experienced a surge in trading activity.",
|
172 |
+
"Investors are optimistic about the future of Indian financial markets.",
|
173 |
+
"Concerns about economic uncertainties are affecting stock prices in India.",
|
174 |
+
"Earnings reports from Indian companies show a positive trend."
|
175 |
+
]
|
176 |
+
|
177 |
+
# Perform sentiment analysis using the fine-tuned FinBERT model
|
178 |
+
results = nlp_pipeline(sentences)
|
179 |
+
print(results)
|
180 |
+
```
|
181 |
+
|
182 |
+
Run the code, and voilà! You'll receive sentiment insights for each sentence.
|
183 |
+
|
184 |
+
Step 4: Incorporate into Your Workflow
|
185 |
+
Integrate this model seamlessly into your financial NLP research or analysis workflows to elevate the accuracy and depth of sentiment assessments related to the Indian stock market.
|
186 |
+
|
187 |
+
Now, you're all set to harness the power of the Fine-Tuned FinBERT model. Happy analyzing! 📈🚀
|
188 |
+
|
189 |
+
[More Information Needed]
|
190 |
+
|
191 |
+
## Training Details
|
192 |
+
|
193 |
+
### Training Data
|
194 |
+
|
195 |
+
**Dataset Information:**
|
196 |
+
|
197 |
+
The Fine-Tuned FinBERT model was trained on a carefully curated dataset consisting of Indian financial news articles with summaries. Here's a brief overview of the dataset and its preparation:
|
198 |
+
|
199 |
+
1. **Data Source:**
|
200 |
+
- The dataset encompasses a wide array of Indian financial news articles, ensuring a diverse and representative sample of content related to the stock market.
|
201 |
+
|
202 |
+
2. **Text Summarization:**
|
203 |
+
- The T5-base model from Hugging Face was employed for text summarization. This step aimed to distill the essential information from each article, providing concise summaries for training the model.
|
204 |
+
|
205 |
+
3. **Sentiment Labeling:**
|
206 |
+
- Sentiment labels for the curated dataset were derived through the GPT add-on for Google Sheets. This process involved annotating the articles with positive, negative, or neutral sentiments, enhancing the model's ability to discern nuanced expressions.
|
207 |
+
|
208 |
+
4. **Contextual Richness:**
|
209 |
+
- The dataset was designed to be contextually rich, exposing the model to a spectrum of sentiment expressions within the Indian stock market landscape. This diversity ensures the model's adaptability to varied scenarios.
|
210 |
+
|
211 |
+
**Dataset Card:**
|
212 |
+
For more detailed information on the dataset, including statistics, features, and documentation related to data pre-processing, please refer to the associated [Dataset Card](link-to-dataset-card).
|
213 |
+
|
214 |
+
This meticulous curation and diverse data incorporation contribute to the model's proficiency in capturing nuanced sentiment expressions relevant to the Indian stock market.
|
215 |
+
|
216 |
+
[More Information Needed]
|
217 |
+
|
218 |
+
### Training Procedure
|
219 |
+
|
220 |
+
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
221 |
+
|
222 |
+
#### Preprocessing [optional]
|
223 |
+
|
224 |
+
[More Information Needed]
|
225 |
+
|
226 |
+
|
227 |
+
#### Training Hyperparameters
|
228 |
+
|
229 |
+
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
230 |
+
|
231 |
+
#### Speeds, Sizes, Times [optional]
|
232 |
+
|
233 |
+
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
234 |
+
|
235 |
+
[More Information Needed]
|
236 |
+
|
237 |
+
## Evaluation
|
238 |
+
|
239 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
240 |
+
|
241 |
+
### Testing Data, Factors & Metrics
|
242 |
+
|
243 |
+
#### Testing Data
|
244 |
+
|
245 |
+
<!-- This should link to a Dataset Card if possible. -->
|
246 |
+
|
247 |
+
[More Information Needed]
|
248 |
+
|
249 |
+
#### Factors
|
250 |
+
|
251 |
+
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
252 |
+
|
253 |
+
[More Information Needed]
|
254 |
+
|
255 |
+
#### Metrics
|
256 |
+
|
257 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
258 |
+
|
259 |
+
[More Information Needed]
|
260 |
+
|
261 |
+
### Results
|
262 |
+
|
263 |
+
[More Information Needed]
|
264 |
+
|
265 |
+
#### Summary
|
266 |
+
|
267 |
+
|
268 |
+
|
269 |
+
## Model Examination [optional]
|
270 |
+
|
271 |
+
<!-- Relevant interpretability work for the model goes here -->
|
272 |
+
|
273 |
+
[More Information Needed]
|
274 |
+
|
275 |
+
## Environmental Impact
|
276 |
+
|
277 |
+
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
278 |
+
|
279 |
+
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
280 |
+
|
281 |
+
- **Hardware Type:** [More Information Needed]
|
282 |
+
- **Hours used:** [More Information Needed]
|
283 |
+
- **Cloud Provider:** [More Information Needed]
|
284 |
+
- **Compute Region:** [More Information Needed]
|
285 |
+
- **Carbon Emitted:** [More Information Needed]
|
286 |
+
|
287 |
+
## Technical Specifications [optional]
|
288 |
+
|
289 |
+
### Model Architecture and Objective
|
290 |
+
|
291 |
+
[More Information Needed]
|
292 |
+
|
293 |
+
### Compute Infrastructure
|
294 |
+
|
295 |
+
[More Information Needed]
|
296 |
+
|
297 |
+
#### Hardware
|
298 |
+
|
299 |
+
[More Information Needed]
|
300 |
+
|
301 |
+
#### Software
|
302 |
+
|
303 |
+
[More Information Needed]
|
304 |
+
|
305 |
+
## Citation [optional]
|
306 |
+
|
307 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
308 |
+
|
309 |
+
**BibTeX:**
|
310 |
+
|
311 |
+
[More Information Needed]
|
312 |
+
|
313 |
+
**APA:**
|
314 |
+
|
315 |
+
[More Information Needed]
|
316 |
+
|
317 |
+
## Glossary [optional]
|
318 |
+
|
319 |
+
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
320 |
+
|
321 |
+
[More Information Needed]
|
322 |
+
|
323 |
+
## More Information [optional]
|
324 |
+
|
325 |
+
[More Information Needed]
|
326 |
+
|
327 |
+
## Model Card Authors [optional]
|
328 |
+
|
329 |
+
[More Information Needed]
|
330 |
+
|
331 |
+
## Model Card Contact
|
332 |
+
|
333 |
+
[More Information Needed]
|
334 |
+
|
335 |
+
|