學術產出-Theses
Article View/Open
Publication Export
-
題名 探討社群媒體對抗式攻擊與防禦對股市交易影響:以Twitter情感分析為範例
Exploring Social Media Adversarial Attack and Defense on Stock Trading Effect: Twitter Sentiment Analysis as an Example作者 溫永靖
Wen, Yung-Ching貢獻者 胡毓忠
Hu, Yuh-Jong
溫永靖
Wen, Yung-Ching關鍵詞 情感分析
深度學習
社群媒體
對抗式攻擊
對抗式防禦
Sentiment analysis
Deep learning
Social media
Adversarial attack
Adversarial defense日期 2023 上傳時間 9-Mar-2023 18:25:40 (UTC+8) 摘要 近年來文字對抗式攻擊廣泛研究,在文字上進行微幅的調整,即會讓機器學習模型辨識錯誤。本文將模擬股票程式交易的情境,探討程式交易模型使用基於BERT模型的FinBERT受到文字對抗式攻擊影響情感辨識時,交易策略的變化,並探討如何因應文字對抗式攻擊。實驗結果發現:(1)使用Twitter討論SPY ETF貼文輔助價格預測,並執行布林通道交易策略,模擬日中交易進行回測,可獲得報酬率20.25%(2)當Twitter貼文受到攻擊者文字對抗式攻擊時,降低情感分析準確率整體下降24.1%與報酬率2.09%。(3)當Twitter受到文字對抗式攻擊時,使用Spark-NLP模型進行對抗式防禦,情感分析準確率會回升1.1%,但對於報酬率回復無影響。
The adversarial attack on the text has been extensively studied in recent years. A little perturbed on the text will let the machine model classify errors. This paper simulates the scenario of the stock program trading, exploring when the program trading model based on the BERT model`s FinBERT was attacked against adversarial attack on the text and was affected the sentiment analysis, the change of trading strategy, and exploring how to solve adversarial attack on text. The experimental results found that(1)We use the Twitter posts which discuss SPY ETF to assist price forecasting and execute Bollinger Band trading strategies, simulate intraday-trading, it can get a 20.25% return rate (2) When Twitter posts were attacked by an adversarial attack, it will reduce sentiment analysis accurate rate 24.1% and return rate will reduce 2.09% (3)When Twitter posts were attacked by an adversarial attack, we use Spark-NLP model can recover sentiment analysis accurate rate 1.1% but no effect on transaction results.參考文獻 [1] C. Gu and A. Kurov, “Informational role of social media: Evidence from twittersentiment,” Journal of Banking & Finance, vol. 121, 2020.[2] G. Ranco, D. Aleksovski, G. Caldarelli, M. Grčar, and I. Mozetič, “The effects oftwitter sentiment on stock price returns,” PloS one, vol. 10, no. 9, 2015.[3] D. F. Araci and Z. Genc, “Financial sentiment analysis with pre-trained languagemodels,” arXiv preprint arXiv:1908.10063, 2019.[4] P. Malo, A. Sinha, P. Korhonen, J. Wallenius, and P. Takala, “Good debt or bad debt:Detecting semantic orientations in economic texts,” Journal of the Association forInformation Science and Technology, vol. 65, no. 4, pp. 782–796, 2014.[5] Y. Hao, L. Dong, F. Wei, and K. Xu, “Visualizing and understanding the effectivenessof bert,” arXiv preprint arXiv:1908.05620, 2019.[6] H. Altin, “Efficient market hypothesis, abnormal return and election periods,” Eu-ropean Scientific Journal, vol. 11, no. 34, 2015.[7] S. Mehdian and M. J. Perry, “Anomalies in us equity markets: A re-examination ofthe january effect,” Applied Financial Economics, vol. 12, no. 2, pp. 141–145, 2002.[8] A. Mittal and A. Goel, “Stock prediction using twitter sentiment analysis,” Stand-ford University, CS229 (2011 http://cs229. stanford. edu/proj2011/GoelMittal-StockMarketPredictionUsingTwitterSentimentAnalysis. pdf), vol. 15, 2012.[9] L. Nemes and A. Kiss, “Prediction of stock values changes using sentiment analysisof stock news headlines,” Journal of Information and Telecommunication, vol. 5,no. 3, pp. 375–394, 2021.[10] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “Bert: Pre-trainingof deep bidirectional transformers for language understanding,” arXiv preprintarXiv:1810.04805, 2018.[11] Y. Zhou, J.-Y. Jiang, K.-W. Chang, and W. Wang, “Learning to discriminate per-turbations for blocking adversarial attacks in text classification,” arXiv preprintarXiv:1909.03084, 2019.[12] I. Alsmadi, K. Ahmad, M. Nazzal, F. Alam, A. Al-Fuqaha, A. Khreishah, and A. Al-gosaibi, “Adversarial attacks and defenses for social network text processing ap-plications: Techniques, challenges and future research directions,” arXiv preprintarXiv:2110.13980, 2021.[13] J. Morris, E. Lifland, J. Y. Yoo, J. Grigsby, D. Jin, and Y. Qi, “Textattack: A frame-work for adversarial attacks, data augmentation, and adversarial training in nlp,” pp.119–126, 2020.[14] I. J. Goodfellow, J. Shlens, and C. Szegedy, “Explaining and harnessing adversarialexamples,” arXiv preprint arXiv:1412.6572, 2014.[15] V. Kocaman and D. Talby, “Spark nlp: natural language understanding at scale,”Software Impacts, vol. 8, 2021.[16] Andreotti, “Applying context aware spell check-ing in spark nlp,” 2020, https://medium.com/spark-nlp/applying-context-aware-spell-checking-in-spark-nlp-3c29c46963bc, Online;Lastaccessed on 2022-12-31.[17] Olah, “Understanding lstm networks,” 2015, http://colah.github.io/posts/2015-08-Understanding-LSTMs/, Online;Last accessed on 2022-12-31.[18] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation,vol. 9, no. 8, pp. 1735–1780, 1997.[19] T. Fischer and C. Krauss, “Deep learning with long short-term memory networks forfinancial market predictions,” European journal of operational research, vol. 270,no. 2, pp. 654–669, 2018.[20] G. Deza, C. Rowat, and N. Papernot, “On the robustness of sentiment analysis forstock price forecasting,” ICLR 2021 Conference Program Chairs, 2020.[21] M. Roondiwala, H. Patel, and S. Varma, “Predicting stock prices using lstm,” In-ternational Journal of Science and Research (IJSR), vol. 6, no. 4, pp. 1754–1756,2017.[22] C. W. Granger, “Investigating causal relations by econometric models and cross-spectral methods,” Econometrica: journal of the Econometric Society, pp. 424–438,1969.[23] J. Bollinger, Bollinger on Bollinger bands. McGraw-Hill New York, 2002.[24] E. Nehemya, Y. Mathov, A. Shabtai, and Y. Elovici, “Taking over the stock market:Adversarial perturbations against algorithmic traders,” pp. 221–236, 2021. 描述 碩士
國立政治大學
資訊科學系碩士在職專班
109971016資料來源 http://thesis.lib.nccu.edu.tw/record/#G0109971016 資料類型 thesis dc.contributor.advisor 胡毓忠 zh_TW dc.contributor.advisor Hu, Yuh-Jong en_US dc.contributor.author (Authors) 溫永靖 zh_TW dc.contributor.author (Authors) Wen, Yung-Ching en_US dc.creator (作者) 溫永靖 zh_TW dc.creator (作者) Wen, Yung-Ching en_US dc.date (日期) 2023 en_US dc.date.accessioned 9-Mar-2023 18:25:40 (UTC+8) - dc.date.available 9-Mar-2023 18:25:40 (UTC+8) - dc.date.issued (上傳時間) 9-Mar-2023 18:25:40 (UTC+8) - dc.identifier (Other Identifiers) G0109971016 en_US dc.identifier.uri (URI) http://nccur.lib.nccu.edu.tw/handle/140.119/143783 - dc.description (描述) 碩士 zh_TW dc.description (描述) 國立政治大學 zh_TW dc.description (描述) 資訊科學系碩士在職專班 zh_TW dc.description (描述) 109971016 zh_TW dc.description.abstract (摘要) 近年來文字對抗式攻擊廣泛研究,在文字上進行微幅的調整,即會讓機器學習模型辨識錯誤。本文將模擬股票程式交易的情境,探討程式交易模型使用基於BERT模型的FinBERT受到文字對抗式攻擊影響情感辨識時,交易策略的變化,並探討如何因應文字對抗式攻擊。實驗結果發現:(1)使用Twitter討論SPY ETF貼文輔助價格預測,並執行布林通道交易策略,模擬日中交易進行回測,可獲得報酬率20.25%(2)當Twitter貼文受到攻擊者文字對抗式攻擊時,降低情感分析準確率整體下降24.1%與報酬率2.09%。(3)當Twitter受到文字對抗式攻擊時,使用Spark-NLP模型進行對抗式防禦,情感分析準確率會回升1.1%,但對於報酬率回復無影響。 zh_TW dc.description.abstract (摘要) The adversarial attack on the text has been extensively studied in recent years. A little perturbed on the text will let the machine model classify errors. This paper simulates the scenario of the stock program trading, exploring when the program trading model based on the BERT model`s FinBERT was attacked against adversarial attack on the text and was affected the sentiment analysis, the change of trading strategy, and exploring how to solve adversarial attack on text. The experimental results found that(1)We use the Twitter posts which discuss SPY ETF to assist price forecasting and execute Bollinger Band trading strategies, simulate intraday-trading, it can get a 20.25% return rate (2) When Twitter posts were attacked by an adversarial attack, it will reduce sentiment analysis accurate rate 24.1% and return rate will reduce 2.09% (3)When Twitter posts were attacked by an adversarial attack, we use Spark-NLP model can recover sentiment analysis accurate rate 1.1% but no effect on transaction results. en_US dc.description.tableofcontents 摘要 iAbstract ii目錄 iii圖目錄 V表目錄 Vii1前言 11.1研究動機 11.2研究目的 21.3研究架構 32文獻探討 42.1效率市場假說文獻回顧 42.2情感分析於股價預測文獻回顧 42.3對抗式技術 52.3.1DeepWordBug 72.3.2對抗式防禦偵測 92.3.3Spark-NLP模型 102.4長短期記憶模型LSTM 102.5文字對抗式攻擊於股市影響 123系統設計 133.1系統概述 133.2預測標的 153.3標的價格相關資料前處理 153.4情感分析特徵工程 163.5格蘭傑因果關係檢測 163.6預測價格模型訓練 163.7交易策略 173.8成果評量 174研究實作 184.1資料來源與週期 184.2交易參數設定 184.3模型參數設定 194.4模型成果評量 194.4.1命題一成果分析 194.4.2命題二成果分析 214.4.3命題三成果分析 254.4.4金融衡量指標統計 285結論與未來展望 305.1研究結果 305.2未來展望 31參考文獻 32 zh_TW dc.format.extent 5522222 bytes - dc.format.mimetype application/pdf - dc.source.uri (資料來源) http://thesis.lib.nccu.edu.tw/record/#G0109971016 en_US dc.subject (關鍵詞) 情感分析 zh_TW dc.subject (關鍵詞) 深度學習 zh_TW dc.subject (關鍵詞) 社群媒體 zh_TW dc.subject (關鍵詞) 對抗式攻擊 zh_TW dc.subject (關鍵詞) 對抗式防禦 zh_TW dc.subject (關鍵詞) Sentiment analysis en_US dc.subject (關鍵詞) Deep learning en_US dc.subject (關鍵詞) Social media en_US dc.subject (關鍵詞) Adversarial attack en_US dc.subject (關鍵詞) Adversarial defense en_US dc.title (題名) 探討社群媒體對抗式攻擊與防禦對股市交易影響:以Twitter情感分析為範例 zh_TW dc.title (題名) Exploring Social Media Adversarial Attack and Defense on Stock Trading Effect: Twitter Sentiment Analysis as an Example en_US dc.type (資料類型) thesis en_US dc.relation.reference (參考文獻) [1] C. Gu and A. Kurov, “Informational role of social media: Evidence from twittersentiment,” Journal of Banking & Finance, vol. 121, 2020.[2] G. Ranco, D. Aleksovski, G. Caldarelli, M. Grčar, and I. Mozetič, “The effects oftwitter sentiment on stock price returns,” PloS one, vol. 10, no. 9, 2015.[3] D. F. Araci and Z. Genc, “Financial sentiment analysis with pre-trained languagemodels,” arXiv preprint arXiv:1908.10063, 2019.[4] P. Malo, A. Sinha, P. Korhonen, J. Wallenius, and P. Takala, “Good debt or bad debt:Detecting semantic orientations in economic texts,” Journal of the Association forInformation Science and Technology, vol. 65, no. 4, pp. 782–796, 2014.[5] Y. Hao, L. Dong, F. Wei, and K. Xu, “Visualizing and understanding the effectivenessof bert,” arXiv preprint arXiv:1908.05620, 2019.[6] H. Altin, “Efficient market hypothesis, abnormal return and election periods,” Eu-ropean Scientific Journal, vol. 11, no. 34, 2015.[7] S. Mehdian and M. J. Perry, “Anomalies in us equity markets: A re-examination ofthe january effect,” Applied Financial Economics, vol. 12, no. 2, pp. 141–145, 2002.[8] A. Mittal and A. Goel, “Stock prediction using twitter sentiment analysis,” Stand-ford University, CS229 (2011 http://cs229. stanford. edu/proj2011/GoelMittal-StockMarketPredictionUsingTwitterSentimentAnalysis. pdf), vol. 15, 2012.[9] L. Nemes and A. Kiss, “Prediction of stock values changes using sentiment analysisof stock news headlines,” Journal of Information and Telecommunication, vol. 5,no. 3, pp. 375–394, 2021.[10] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “Bert: Pre-trainingof deep bidirectional transformers for language understanding,” arXiv preprintarXiv:1810.04805, 2018.[11] Y. Zhou, J.-Y. Jiang, K.-W. Chang, and W. Wang, “Learning to discriminate per-turbations for blocking adversarial attacks in text classification,” arXiv preprintarXiv:1909.03084, 2019.[12] I. Alsmadi, K. Ahmad, M. Nazzal, F. Alam, A. Al-Fuqaha, A. Khreishah, and A. Al-gosaibi, “Adversarial attacks and defenses for social network text processing ap-plications: Techniques, challenges and future research directions,” arXiv preprintarXiv:2110.13980, 2021.[13] J. Morris, E. Lifland, J. Y. Yoo, J. Grigsby, D. Jin, and Y. Qi, “Textattack: A frame-work for adversarial attacks, data augmentation, and adversarial training in nlp,” pp.119–126, 2020.[14] I. J. Goodfellow, J. Shlens, and C. Szegedy, “Explaining and harnessing adversarialexamples,” arXiv preprint arXiv:1412.6572, 2014.[15] V. Kocaman and D. Talby, “Spark nlp: natural language understanding at scale,”Software Impacts, vol. 8, 2021.[16] Andreotti, “Applying context aware spell check-ing in spark nlp,” 2020, https://medium.com/spark-nlp/applying-context-aware-spell-checking-in-spark-nlp-3c29c46963bc, Online;Lastaccessed on 2022-12-31.[17] Olah, “Understanding lstm networks,” 2015, http://colah.github.io/posts/2015-08-Understanding-LSTMs/, Online;Last accessed on 2022-12-31.[18] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation,vol. 9, no. 8, pp. 1735–1780, 1997.[19] T. Fischer and C. Krauss, “Deep learning with long short-term memory networks forfinancial market predictions,” European journal of operational research, vol. 270,no. 2, pp. 654–669, 2018.[20] G. Deza, C. Rowat, and N. Papernot, “On the robustness of sentiment analysis forstock price forecasting,” ICLR 2021 Conference Program Chairs, 2020.[21] M. Roondiwala, H. Patel, and S. Varma, “Predicting stock prices using lstm,” In-ternational Journal of Science and Research (IJSR), vol. 6, no. 4, pp. 1754–1756,2017.[22] C. W. Granger, “Investigating causal relations by econometric models and cross-spectral methods,” Econometrica: journal of the Econometric Society, pp. 424–438,1969.[23] J. Bollinger, Bollinger on Bollinger bands. McGraw-Hill New York, 2002.[24] E. Nehemya, Y. Mathov, A. Shabtai, and Y. Elovici, “Taking over the stock market:Adversarial perturbations against algorithmic traders,” pp. 221–236, 2021. zh_TW