Using Python for Text Analysis in Accounting Research

Tax eJournal Pub Date : 2020-09-23 DOI:10.1561/1400000062
Vic Anand, Khrystyna Bochkay, Roman Chychyla, A. Leone
{"title":"Using Python for Text Analysis in Accounting Research","authors":"Vic Anand, Khrystyna Bochkay, Roman Chychyla, A. Leone","doi":"10.1561/1400000062","DOIUrl":null,"url":null,"abstract":"The prominence of textual data in accounting research has increased dramatically. To assist researchers in understanding and using textual data, this monograph defines and describes common measures of textual data and then demonstrates the collection and processing of textual data using the Python programming language. The monograph is replete with sample code that replicates textual analysis tasks from recent research papers.\r\n\r\nIn the first part of the monograph, we provide guidance on getting started in Python. We first describe Anaconda, a distribution of Python that provides the requisite libraries for textual analysis, and its installation. We then introduce the Jupyter notebook, a programming environment that improves research workflows and promotes replicable research. Next, we teach the basics of Python programming and demonstrate the basics of working with tabular data in the Pandas package.\r\n\r\nThe second part of the monograph focuses on specific textual analysis methods and techniques commonly used in accounting research. We first introduce regular expressions, a sophisticated language for finding patterns in text. We then show how to use regular expressions to extract specific parts from text. Next, we introduce the idea of transforming text data (unstructured data) into numerical measures representing variables of interest (structured data). Specifically, we introduce dictionary-based methods of 1) measuring document sentiment, 2) computing text complexity, 3) identifying forward-looking sentences and risk disclosures, 4) collecting informative numbers in text, and 5) computing the similarity of different pieces of text. For each of these tasks, we cite relevant papers and provide code snippets to implement the relevant metrics from these papers.\r\n\r\nFinally, the third part of the monograph focuses on automating the collection of textual data. We introduce web scraping and provide code for downloading filings from EDGAR.","PeriodicalId":22313,"journal":{"name":"Tax eJournal","volume":"142 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2020-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"11","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Tax eJournal","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1561/1400000062","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 11

Abstract

The prominence of textual data in accounting research has increased dramatically. To assist researchers in understanding and using textual data, this monograph defines and describes common measures of textual data and then demonstrates the collection and processing of textual data using the Python programming language. The monograph is replete with sample code that replicates textual analysis tasks from recent research papers. In the first part of the monograph, we provide guidance on getting started in Python. We first describe Anaconda, a distribution of Python that provides the requisite libraries for textual analysis, and its installation. We then introduce the Jupyter notebook, a programming environment that improves research workflows and promotes replicable research. Next, we teach the basics of Python programming and demonstrate the basics of working with tabular data in the Pandas package. The second part of the monograph focuses on specific textual analysis methods and techniques commonly used in accounting research. We first introduce regular expressions, a sophisticated language for finding patterns in text. We then show how to use regular expressions to extract specific parts from text. Next, we introduce the idea of transforming text data (unstructured data) into numerical measures representing variables of interest (structured data). Specifically, we introduce dictionary-based methods of 1) measuring document sentiment, 2) computing text complexity, 3) identifying forward-looking sentences and risk disclosures, 4) collecting informative numbers in text, and 5) computing the similarity of different pieces of text. For each of these tasks, we cite relevant papers and provide code snippets to implement the relevant metrics from these papers. Finally, the third part of the monograph focuses on automating the collection of textual data. We introduce web scraping and provide code for downloading filings from EDGAR.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
用Python进行会计研究中的文本分析
文本数据在会计研究中的重要性急剧增加。为了帮助研究人员理解和使用文本数据,本专著定义和描述了文本数据的常用度量,然后演示了使用Python编程语言收集和处理文本数据。该专著充满了从最近的研究论文复制文本分析任务的示例代码。在本专著的第一部分中,我们提供了入门Python的指导。我们首先描述Anaconda (Python的一个发行版,它提供了文本分析所需的库)及其安装。然后我们介绍Jupyter notebook,这是一个改进研究工作流程并促进可复制研究的编程环境。接下来,我们将教授Python编程的基础知识,并演示如何处理Pandas包中的表格数据。专著的第二部分侧重于会计研究中常用的具体文本分析方法和技术。我们首先介绍正则表达式,这是一种用于在文本中查找模式的复杂语言。然后我们将展示如何使用正则表达式从文本中提取特定部分。接下来,我们介绍将文本数据(非结构化数据)转换为表示感兴趣变量(结构化数据)的数值度量的思想。具体来说,我们介绍了基于词典的方法:1)测量文档情感,2)计算文本复杂性,3)识别前瞻性句子和风险披露,4)收集文本中的信息数字,以及5)计算不同文本片段的相似性。对于这些任务中的每一个,我们都引用相关的论文,并提供代码片段来实现这些论文中的相关度量标准。最后,专著的第三部分侧重于文本数据收集的自动化。我们介绍了网页抓取,并提供了从EDGAR下载文件的代码。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
New Puzzles in International Tax Agreements Analysts’ GAAP earnings forecast quality Workplace Transformation and Its Tax Compliance Implications Consumption Taxes and Multinational Tax Planning in the Digital Age - Evidence from the European Service Sector Tax Avoidance and Equity Pricing: The Importance of Countries’ Legal Institutions and Disclosure Regulations
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1