# README ## finBERT 我們利用 finBERT 這個預訓練好的情感分析模型,將我們金融相關的新聞資料轉成向量,方便我們輸入到模型做訓練,主要參考 ARACI, Dogu[1] 的論文 ### 執行環境 * 參考 repo https://github.com/ProsusAI/finBERT * environment * name: finbert channels: - pytorch - anaconda - conda-forge - defaults dependencies: - jupyter=1.0.0 - pandas=0.23.4 - python=3.7.3 - numpy==1.16.3 - nltk - tqdm - ipykernel=5.1.3 - transformers=4.1.1 - pip: - joblib==0.13.2 - scikit-learn==0.21.2 - spacy==2.1.4 - torch==1.1.0 - textblob * 利用 pre-trained BERT 再丟 financial 相關的新聞做 fine tuning * 可以下載預訓練好的模型參數,放到 models 資料夾下面 * 下載 config.json 放到與 model 相同的資料夾下面 ### 執行方法 利用 ```python3 predict.py``` 去預測你的新聞,會輸出對於每個字串對於金融上的評價 * logit = 正面、負面、平,這三個面向的機率 * prediction = 以最大的機率的面向當作這句話的預測 * sentiment score = 正面機率 - 負面機率 ### 參考資料 1. ARACI, Dogu. Finbert: Financial sentiment analysis with pre-trained language models. arXiv preprint arXiv:1908.10063, 2019. 2. https://github.com/ProsusAI/finBERT