Instructions to use AlGatone21/SwissFinBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlGatone21/SwissFinBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AlGatone21/SwissFinBERT")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("AlGatone21/SwissFinBERT") model = AutoModelForSequenceClassification.from_pretrained("AlGatone21/SwissFinBERT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
SwissFinBERT
Model Description
SwissFinBERT is a fine-tuned BERT model specifically designed for financial sentiment analysis in the context of the Swiss stock market. It has been trained on a comprehensive dataset of Swiss financial news articles to accurately classify the sentiment of financial texts as positive (BUY), neutral (HOLD), or negative (SELL).
Model Details
- Model type: BERT
- Base Model: German FinBERT SC
- Language: German
- Domain: Financial sentiment analysis
- Training data: Approximately 28,000 articles from Swiss financial news sources including Finanz und Wirtschaft, Inside Paradeplatz, finews.ch, Neue Zürcher Zeitung, and SRF News.
- Fine-tuning dataset: Titles of the scraped news articles labeled using OpenAI’s GPT-3.5-turbo-0125.
- Performance: Achieved a validation/test accuracy of 78% and an aggregated accuracy of 87% on the finetuning dataset. 93% Accuracy on the German (translated) financial phrasebank of Scherrmann (2023)
Intended Use
SwissFinBERT is intended for use in financial sentiment analysis tasks, particularly for Swiss financial news articles.
Disclaimer
The outputs of SwissFinBERT are not to be intended as financial advice
How to Use
from transformers import pipeline
# Load the model
model_name = "AlGatone21/SwissFinBERT"
classifier = pipeline("sentiment-analysis", model=model_name)
# Example usage
text = "Die Aktien von UBS stiegen nach der Ankündigung eines neuen CEO."
result = classifier(text)
print(result)
Citation
If you use SwissFinBERT in your research or applications, please cite the following thesis:
Gattoni, A. (2024) Can Large Language Models (LLMs) predict the Swiss Stock Market?, University of St. Gallen, St. Gallen
Contact
For questions or feedback, please contact Alessio Gattoni at alessio.gattoni@gmail.com
- Downloads last month
- 16
Model tree for AlGatone21/SwissFinBERT
Base model
scherrmann/GermanFinBert_SC