Files changed (1) hide show
  1. README.md +0 -233
README.md CHANGED
@@ -1,233 +0,0 @@
1
- ---
2
- base_model: EleutherAI/gpt-neo-125M
3
- library_name: peft
4
- license: mit
5
- metrics:
6
- - accuracy
7
- - precision
8
- - recall
9
- - f1
10
- - Pattern Detection Rate
11
- - Cross-Entropy Loss
12
- tags:
13
- - finance, IndianStocks, Technical Analysis, Chartless Trading
14
- language:
15
- - en
16
- pipeline_tag: text-generation
17
- ---
18
-
19
- ---
20
- base_model: EleutherAI/gpt-neo-125M
21
- library_name: peft
22
- ---
23
-
24
- # Model Description
25
-
26
- **IndicFinGPT** is a specialized transformer model, re-engineered from **EleutherAI's GPT-Neo-125M** architecture, which is a GPT-3 class architecture, designed specifically for the **Indian financial market**. The model has undergone **retraining on its top layers** to enhance its performance in providing insights into the **top 100 companies listed in the NIFTY50 Index, BSE, and NSE exchanges**.
27
- The primary objective of this model is to **serve the unique needs of Indian stock markets** and **investors engaged in chartless trading**. IndicFinGPT aims to provide insights that could **minimize capital loss and drawdowns** while **maximizing financial ratios** such as the **Sharpe, Sortino, Calmar, Omega, and Treynor Ratios**. Additionally, the model is designed to help in **reducing maximum drawdowns** in financial portfolios, offering a robust AI solution tailored to **India’s dynamic financial landscape**.
28
-
29
- ## First Indic-Stock Small Language Model Focused Top 100 Companies Listed in NSE and BSE Stock Exchanges
30
-
31
- <p align="center">
32
- <img src="https://huggingface.co/bhaskartripathi/GPT_Neo_Market_Analysis/resolve/main/indicBull.JPG" alt="IndicFinGPT Logo" width="400" height="300">
33
- <strong>भारतीय बाजार की शीर्ष 100 कंपनियों का वित्तीय विश्लेषण करने वाला पहला Small Language Model</strong>
34
- </p>
35
-
36
- ## Training Data and Procedure
37
-
38
- **IndicFinGPT 125M** utilizes the **Pile dataset** created by EleutherAI and includes the **top 100 tickers** (by volume and liquidity) from Indian stock markets, covering data from **January 1, 2018, to October 30, 2024**. This dataset encompasses diverse market periods, including **pre-COVID-19 (stable), COVID-19 (volatile), and post-COVID-19 (recovery phase)**. Such comprehensive data exposure allows the model to recognize **problem-solution patterns across various bull and bear runs**.
39
- The training data also incorporates **local influences** such as cultural factors and **market-specific volatility**, enhancing its ability to perform **automated technical analysis** for chartless trading. Key capabilities include identifying **classical chart patterns** using technical analysis, conducting **earnings analysis**, interpreting **market sentiment** from multiple sources, and **assessing risks**, all aimed at **improving decision-making for Indian investors**.
40
- This model weights were obtained after **310 billion tokens over 692,380 steps**. It utilized 4-bit Quantized Low-Rank Adoption (PEFT) method on top of the masked autoregressive language model architecture of Neo, utilizing cross-entropy loss, F1, Accuracy, Precision, recall,Pattern Detection Rate, and Cross-Entropy Loss as performance metrics.
41
-
42
-
43
- ## Key Highlights
44
-
45
- 1. Trading Patterns: Specialized in recognizing BSE/NSE-specific patterns and cycles
46
- 2. Market Sentiment: Built-in understanding of Indian market sentiment and cultural influences
47
- 3. Macro-Economic Indicators: Adapted to domestic economic and financial metrics
48
- 4. Indian Economic Influences: Awareness of timing, festival impacts, and market-specific volatility
49
-
50
-
51
- ## Implementation
52
-
53
- ### Quick Start
54
- ```python
55
- from transformers import AutoTokenizer, AutoModelForCausalLM
56
-
57
- model = AutoModelForCausalLM.from_pretrained("bhaskartripathi/GPT_Neo_Market_Analysis")
58
- tokenizer = AutoTokenizer.from_pretrained("bhaskartripathi/GPT_Neo_Market_Analysis")
59
-
60
- input_text = '''[INST] Given the following stock market data and technical analysis:
61
- Stock: EXAMPLE
62
- Date: 2024-01-01
63
- Technical Analysis:
64
- Current Price: ₹100
65
- Daily Range: ₹98 - ₹102
66
- Trading Volume: 1,000,000
67
- RSI: 55
68
- MACD: Bullish
69
- Based on this technical analysis, what is the likely price movement for tomorrow and why? [/INST]'''
70
-
71
- inputs = tokenizer(input_text, return_tensors="pt")
72
- outputs = model.generate(**inputs, max_new_tokens=50)
73
- result = tokenizer.decode(outputs[0], skip_special_tokens=True)
74
- ```
75
-
76
- ## Training Details
77
-
78
- ### Dataset and Fine-tuning
79
- - **Dataset**: Comprehensive dataset featuring 6 years of Indian market data.
80
- - **Method**: Fine-tuned using QLoRA (4-bit quantization) for optimal efficiency.
81
- - **Training Infrastructure**: Utilized an Nvidia T4 GPU, trained for ~6 hours with PEFT framework version 0.13.2.
82
-
83
- ## Performance Metrics
84
- - **Pattern Recognition**: High accuracy in classical and advanced pattern detection in Indian markets.
85
- - **Sentiment Correlation**: Strong alignment with local market movements.
86
- - **Risk & Volatility Handling**: Reliable risk analysis in volatile market conditions.
87
-
88
- ## Market Understanding
89
-
90
- ### Technical Analysis Expertise
91
- The model is adept at identifying crucial market formations including:
92
- - **Classical Patterns**: Head & Shoulders, Double Top/Bottom, Triangle, Flag, Wedge, Cup and Handle.
93
- - **Advanced Techniques**: Local support and resistance levels, volume analysis, and momentum indicators specifically tailored to Indian volatility.
94
-
95
- ### Market Intelligence
96
- IndicFinGPT includes:
97
- - **Comprehensive Financial Reports**: Analysis of quarterly and annual earnings.
98
- - **Risk Metrics**: Indian-adapted VaR, Beta, and volatility models.
99
-
100
- ### Cultural Context in Trading
101
- Culturally aware strategies include:
102
- - **Indian Market Timing**: Recommendations tailored to pre-market, regular, and post-market phases.
103
- - **Festival & Cultural Factors**: Insights into events like Diwali (Muhurat Trading), budget announcements, and investor sentiment.
104
- - **FII/DII Flow and Retail Behavior**: Specific guidance considering both institutional and retail dynamics.
105
-
106
- ## Social Impact
107
-
108
- IndicFinGPT democratizes sophisticated AI-based financial analysis for the Indian stock market, providing affordable and accessible tools for both seasoned investors and new traders.
109
-
110
- ## Core Capabilities
111
-
112
- #### Automated Q&A based Technical Analysis for chartless Trading:
113
- Investors, Traders, Economists, Econometricians and Researchers can ask any types of questions related to the below areas:
114
-
115
- - **Head and Shoulders patterns**
116
- - What are the implications of a Head and Shoulders pattern forming for Tata Consultancy Services (TCS) in the upcoming week?
117
- - How does the identification of a Head and Shoulders pattern for Reliance Industries influence its potential price movement?
118
-
119
- - **Double Top/Bottom patterns**
120
- - What is the expected market behavior for Infosys if a Double Top pattern has formed over the last two weeks?
121
- - How does a Double Bottom pattern in Tata Steel indicate a possible upward trend?
122
-
123
- - **Triangle formations**
124
- - What trading opportunities are indicated by a symmetrical triangle formation in Hindustan Unilever?
125
- - How could an ascending triangle in Tata Motors impact its price performance in the coming days?
126
-
127
- - **Flag patterns**
128
- - What are the implications of a bullish flag pattern for the stock of Infosys in the short term?
129
- - How can a flag pattern formation in Reliance Industries affect trading strategies for the next three days?
130
-
131
- - **Wedge patterns**
132
- - How does a rising wedge pattern in Tata Steel signal a potential market reversal?
133
- - What are the likely outcomes of a falling wedge pattern detected in Tata Consultancy Services (TCS)?
134
-
135
- - **Cup and Handle patterns**
136
- - Can you provide an analysis of a Cup and Handle pattern formation in Hindustan Unilever?
137
- - How could a Cup and Handle pattern affect the price movement of Reliance Industries in the coming week?
138
-
139
- Earnings Analysis:
140
-
141
- - **Key metrics extraction**
142
- - What are the key earnings metrics extracted for Infosys for the latest quarter?
143
- - How do the extracted financial metrics for Tata Motors compare to previous earnings?
144
-
145
- - **Historical comparisons**
146
- - How does the historical earnings performance of Tata Consultancy Services (TCS) compare to the current quarter?
147
- - What insights can be gained by comparing historical earnings of Hindustan Unilever over the last three years?
148
-
149
- - **Red flag identification**
150
- - Are there any red flags in the latest earnings report of Reliance Industries?
151
- - What potential risks are identified in Tata Steel's financial report?
152
-
153
- - **Positive indicator detection**
154
- - What are the positive financial indicators in the latest earnings of Tata Motors?
155
- - How do the positive indicators for Infosys reflect its market position?
156
-
157
- Market Sentiment Interpretation:
158
-
159
- - **Price-based sentiment analysis**
160
- - How does the recent price movement of Reliance Industries reflect market sentiment?
161
- - What sentiment indicators can be derived from the price fluctuations of Tata Steel?
162
-
163
- - **News sentiment analysis**
164
- - How might recent news regarding Tata Consultancy Services (TCS) impact its stock price in the next few days?
165
- - What is the sentiment derived from the latest business news about Hindustan Unilever?
166
-
167
- - **Social media sentiment analysis**
168
- - How is social media sentiment trending for Infosys, and what impact could this have on its stock price?
169
- - What does the current social media sentiment indicate about Tata Motors in the upcoming week?
170
-
171
- - **Sentiment divergence calculation**
172
- - How does the divergence between price-based sentiment and news sentiment impact the outlook for Tata Consultancy Services (TCS)?
173
- - What are the implications of a sentiment divergence for Reliance Industries over the next few days?
174
-
175
- Risk Assessment:
176
-
177
- - **Volatility analysis**
178
- - What does the volatility analysis indicate for Tata Steel over the next week?
179
- - How volatile is the stock of Hindustan Unilever in the current market scenario?
180
-
181
- - **Beta calculation**
182
- - How does the beta of Tata Motors compare to other companies in the Nifty 50 index?
183
- - What does the beta calculation imply about the risk associated with Infosys?
184
-
185
- - **Value at Risk (VaR) computation**
186
- - What is the VaR for Reliance Industries, considering the current market conditions?
187
- - How does the VaR for Tata Consultancy Services (TCS) help in understanding the potential risk in the next three days?
188
-
189
- - **Risk rating determination**
190
- - How is the risk rating for Hindustan Unilever determined based on current data?
191
- - What is the risk rating for Tata Steel, and how could it influence trading strategies?
192
-
193
- Trading Strategy Recommendations:
194
-
195
- - **Pattern-based analysis**
196
- - What are the potential trading opportunities for Reliance Industries based on recent flag or wedge pattern formations in the next week?
197
- - How does the Double Top pattern for Tata Steel indicate a possible trend reversal in the coming days?
198
-
199
- - **Sentiment-driven insights**
200
- - How might recent news and social media sentiment affect the stock price of Infosys over the next three days?
201
- - What is the current sentiment regarding Tata Consultancy Services (TCS), and how could it impact its performance over the next week?
202
-
203
- - **Risk-adjusted recommendations**
204
- - What are the risk-adjusted trading strategies for Infosys in light of current market volatility?
205
- - Based on beta calculations and current market sentiment, what are the recommended actions for Tata Steel in the coming days?
206
-
207
- - **Historical context integration**
208
- - How have similar market conditions in the past affected the performance of Hindustan Unilever, and what can be expected this week?
209
- - Considering past Diwali trading patterns, what is the expected impact on Reliance Industries this year?
210
-
211
- ## Evaluation Results
212
-
213
- #WandB Report: https://wandb.ai/bhaskar-tripathi-indian-institute-of-foreign-trade/indian-market-analysis-system/workspace
214
-
215
- <p align="center">
216
- <img src="https://huggingface.co/bhaskartripathi/GPT_Neo_Market_Analysis/resolve/main/eval_results.JPG" alt="IndicFinGPT Logo" width="1024" height="800">
217
- </p>
218
-
219
- ## Citation
220
- ```bibtex
221
- @misc{tripathi2024indicfin,
222
- title={IndicFinGPT: Market Analysis Model for Indian Stocks},
223
- author={Bhaskar Tripathi},
224
- year={2024},
225
- url={https://huggingface.co/bhaskartripathi/GPT_Neo_Market_Analysis}
226
- }
227
- ```
228
-
229
- ## Contact
230
- - **Email**: bhaskar.tripathi@volkswagen.co.in
231
- - **HuggingFace**: [@bhaskartripathi](https://huggingface.co/bhaskartripathi)
232
- - **Google Scholar**: [Profile](https://scholar.google.com/citations?user=SCHOLAR_ID)
233
- - **Github**: [Click Here](https://github.com/bhaskatripathi)