<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amy Yang on Medium]]></title>
        <description><![CDATA[Stories by Amy Yang on Medium]]></description>
        <link>https://medium.com/@amyyang-syd?source=rss-1ad7fe15bc03------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*p0NILTKtrzZgFTevLzmjmg.jpeg</url>
            <title>Stories by Amy Yang on Medium</title>
            <link>https://medium.com/@amyyang-syd?source=rss-1ad7fe15bc03------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:30:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amyyang-syd/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Critical Summary on the Ethical Use of NLP]]></title>
            <link>https://medium.com/@amyyang-syd/critical-summary-on-the-ethical-use-of-nlp-d0bfc6ba6273?source=rss-1ad7fe15bc03------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0bfc6ba6273</guid>
            <category><![CDATA[ai-safety]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[ai-ethics]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Amy Yang]]></dc:creator>
            <pubDate>Sat, 08 Apr 2023 00:32:11 GMT</pubDate>
            <atom:updated>2023-04-08T02:47:47.780Z</atom:updated>
            <content:encoded><![CDATA[<h4>Safety Issues of Chatbots in the Healthcare Industry</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eM6p-cj6mkXBu3D1_bD5RA.jpeg" /><figcaption>Photo by <a href="https://www.istockphoto.com/portfolio/RaStudio?mediatype=illustration">Visual Generation</a> on iStock</figcaption></figure><h3>Introduction</h3><p>Applications of Natural Language Processing (NLP) have been increasingly prevalent over the last few years such as sentiment analysis, language translation, speech recognition, chatbots, named entity recognition, text summarisation and so on. Chatbots are one of the most used applications in a variety of industries to automate repetitive tasks and increase customer engagement.</p><p>With the wide use of chatbots, several ethical issues are drawn attention and need to be addressed to ensure they are developed and used responsibly. The main ethical issues associated with chatbots include transparency, bias, safety and privacy.</p><p><strong>Transparency — </strong>Being transparent about the status of a dialogue agent as non-human and the limitation on its capabilities enables users to make informed decisions and helps to build more trust with users (Ruane et al., 2019). This is especially important where sensitive information is provided by users such as financial details, and health concerns.</p><p><strong>Bias — </strong>Henderson et al. (2018) suggested that chatbots can inherit biases of gender, race, personal viewpoint, and several others from the data used to train and that biases are likely to be encoded in language models and dialogue systems.</p><p><strong>Safety — </strong>In chatbots, safety risks lie with the possibility of offensive or harmful effects on human interlocutors (Henderson et al., 2018). As explained by Henderson et al. (2018), stability and coherent output are difficult to achieve in dialogue systems and thus model divergence could possibly lead to undesirable behaviours without performance guarantees. One example is the Microsoft Tay Chatbot in March 2016, which generated offensive and inflammatory tweets including racist, sexist and anti-Semitic statements within hours of its launch. The Tay chatbot scandal emphasised the importance of considering safety concerns when chatbots and other AI systems are designed and implemented.</p><p><strong>Privacy </strong>— The interaction between humans and chatbots also raises privacy concerns about data collection, access, storage and usage. Ruane et al. (2019) indicated that users may be inclined to self-disclose considering the user-agent interaction is anonymous and the self-disclosure helps to improve user experience. To avoid users’ information being leaked or misused, chatbots should be designed and implemented to comply with legal requirements such as GDPR or any other privacy guidelines.</p><p>Admittedly, each issue described above can play a vital role in the development of ethical dialogue systems applied in various industries. Further discussion will be concentrated on safety issues of chatbot applications in the healthcare industry by reason of the following considerations:</p><ul><li>The potential safety risks associated with chatbots are significant as they are likely to result in physical or emotional harm to users. For example, harmful medical advice provided by chatbots could put a user’s health at risk. Similarly, chatbots that are designed to manipulate or deceive users could have negative consequences for users’ emotional and psychological well-being such as anxiety, stress or mistrust.</li><li>In terms of ethical concerns for chatbots, safety issues are rarely discussed in the literature or in practice (Henderson et al., 2018). The exploration and discussion on how to improve the safety of chatbots could potentially contribute to the refinement of dialogue systems in the healthcare industry and make a positive impact on patients.</li></ul><h3>Approach</h3><p>To carry out the initial research on the ethical use of chatbots, ChatGPT was used to gain general ideas on the types of ethical issues associated with chatbots and the impact of these issues on the healthcare industry. With a better understanding of the issues, a number of relevant journals were identified by searching the keywords in Google Scholar such as ‘safety issues of chatbots in healthcare’. By reviewing the journals and existing research, key findings were summarised relating to the current development of chatbot applications in the healthcare industry and served as evidence for the Critical Discussion in the following section.</p><p>The approach used combines the application of ChatGPT and the perusal of relevant research papers with the benefits and limitations of ChatGPT taken into consideration. On the one hand, ChatGPT is a powerful language model which has a strong capability of generating responses to questions, summarising long text, and helping users to explore information or topics (Tarapara, 2023). This serves as a more efficient way to understand an unfamiliar topic or area compared to researching from scratch and summarising the information by ourselves. On the other hand, as indicated by George (2023), ChatGPT has some limitations for research writing such as the incapability of creating original ideas, potential risks to generate inaccurate or inconsistent research content, limited knowledge of events that occurred after 2021 and so forth. Considering the existing limitations of ChatGPT, a detailed review of research papers was performed to guarantee the accuracy of the content and minimise the risks of plagiarism.</p><h3>Critical Discussion</h3><h4>Findings</h4><p>Researchers have raised several concerns about safety risks for chatbots in healthcare. One main area of safety concern is in medical domains, where chatbots are used to manage emergency situations or provide medication recommendations (Bickmore et al., 2018). Bickmore et al. (2018) pointed out the potential safety risks when users act on the incomplete or inaccurate information provided by chatbots without consulting medical professionals. In their study where Siri, Alexa and Google Assistant were asked to decide on an action for medical problems, 29% of reported actions are likely to cause patient harm, including 16% that could result in death. Parviainen &amp; Rantala (2021) suggested chatbots lack the capability in assessing patients accurately and may cause indirect harm to patients by not knowing the full details of personal factors associated with them.</p><p>Another concern is over-reliance on chatbots by users who may become over-attached to chatbots and avoid visiting mental health professionals in person. Parviainen &amp; Rantala (2021) expressed their concern — ‘There are risks involved when patients are expected to self-diagnose, such as a misdiagnosis provided by the chatbot or patients potentially lacking an understanding of the diagnosis’. Patients’ trust in a chatbot may impact how they value a doctor’s views and impair their trust in physicians. Also, the use of chatbots in the long term might have a negative impact on patients’ behaviour such as a lack of personal contact, and loss of capability in managing conflict (Denecke et al., 2021).</p><h4>Discussion</h4><p>The safety issues of healthcare chatbots could have a widespread impact on society and affect different stakeholders in the healthcare industry including patients, healthcare providers, chatbot developers and regulatory agencies.</p><p><strong>Patients — </strong>Chatbots could potentially provide patients with inaccurate or incomplete information, resulting in misdiagnosis, incorrect treatment or delays in receiving necessary care. The safety issues could also raise questions about the reliability and accuracy of chatbots and decrease patients’ trust in healthcare chatbots or technology-based healthcare solutions more broadly. Based on the study run by UserTesting of five healthcare chatbot apps (Ada, HealthTap, Mediktor, Your.MD and Symptomate), consumers do not fully trust the diagnosis and information provided by the chatbots (Dietsche, 2019). They were cautious about the unfamiliar drug brands recommended by the chatbots and questioned whether those brands comply with HIPAA standards. The potential safety risks could increase the distrust of chatbots among patients and discourage them from using chatbots for healthcare services.</p><p><strong>Healthcare providers <em>— </em></strong>Healthcare providers who use chatbots in clinical practices could be at risk of liability for any incorrect or harmful advice provided by chatbots. The incapability of chatbots may also impair trust in healthcare services (Parviainen &amp; Rantala, 2021). In addition, as advised by Parviainen &amp; Rantala (2021), the safety issues of chatbot applications are likely to increase the workload in clinical practices instead of a reduction. Due to patient self-diagnoses, healthcare providers may need to spend time and effort to convince patients’ potential preliminary misjudgement, leading to an increase in their workloads. Apart from this, clinicians lack trust in the capabilities of chatbots and have concerns about potential clinical risks and issues of accountability (Parviainen &amp; Rantala, 2021). The distrust and uncertainties about chatbots give rise to a higher ‘cognitive load’ (Zhou et al., 2017) of professionals and affect their work memory.</p><p><strong>Chatbot developers<em> — </em></strong>Chatbot developers take responsibility for designing and programming chatbots that can function with safety, reliability and accuracy. They may face legal action if their chatbots cause harm to patients or healthcare providers. At the same time, the safety issues associated with chatbots can jeopardize the reputation of the developer and the company they work for. The loss of trust in chatbots among patients and healthcare providers may lead to decreased adoption and use of chatbots, which affect the developers and companies that are specialised in chatbot development.</p><p><strong>Regulatory agencies — </strong>The safety issues with healthcare chatbots can have an important impact on regulatory agencies related to overseeing the development, deployment and use of chatbots. Regulatory agencies may enforce legal and financial penalties against developers and companies that fail to comply with the regulatory requirement. Also, there could be increased regulatory scrutiny of chatbots to ensure the relevant laws, regulations and standards are complied with. For example, more frequent and rigorous audits and evaluations can be conducted by regulatory agencies. Meanwhile, regulatory agencies may develop new regulations or guidelines specifically for healthcare chatbots considering their great impact on patients and healthcare providers.</p><h4>Critical Analysis</h4><p>There are several approaches to counter the effects of safety issues associated with chatbots in the healthcare industry. Pros and cons are identified for each approach below.</p><p><strong><em>Developing a framework for governing chatbot use in healthcare</em></strong></p><p>One of the key approaches is to develop a framework for governing the use of chatbots in healthcare services, which requires input from various stakeholders including healthcare providers, regulatory bodies, and technology experts. In December 2020, a framework named ‘Chatbots RESET’ was created to govern the responsible use of chatbots in healthcare by the World Economic Forum and Mitsubishi Chemical Holdings Corporation together (World Economic Forum, 2020). The framework introduced ten principles for the responsible use of chatbots and recommended actions that can be taken to implement the principles by three types of stakeholders including developers, providers, and regulators (Venkataraman &amp; Arunima, 2020). Providers consist of hospitals, insurance companies, technology providers (direct to patients) and the government (as a provider).</p><p>The approach has both advantages and disadvantages. On the one hand, it could have a crucial impact on the improvement of healthcare services. The framework that includes appropriate safety measures can minimise the risks of inaccurate or unsafe medical advice provided by chatbots and build trust in the use of healthcare chatbots from both patients and healthcare providers. Concurrently an established framework could provide better guidelines to a variety of stakeholders in developing, deploying and regulating the responsible use of healthcare chatbots. On the other hand, developing and implementing a framework for the use of chatbots in healthcare may require significant resources in terms of time, money and personnel. The slow implementation of a framework along with the complex regulations and guidelines could create barriers for healthcare providers and constrain the innovation of chatbot solutions.</p><p><strong><em>Designing a reliable handoff system in healthcare chatbots</em></strong></p><p>Another approach is to design a reliable handoff system in chatbots so that a patient can be transferred from a chatbot to a human healthcare provider when necessary, ensuring that patients receive the appropriate level of care and attention. There are several ways to trigger the handoff system, for example, the patient may request to talk with a human healthcare provider or the chatbot may recoginise its inability to address the patient’s needs. Alternatively, when a certain amount of time has passed or if the patient’s concerns meet certain severity criteria, the transfer will proceed.</p><p>Designing a reliable handoff system in chatbots is beneficial to both patients and healthcare providers. The handoff system could enable patients to choose the level of care they need and improve patients’ outcomes by providing the proper medical advice or managing emergency situations. In addition, the system could contribute to the efficiency improvement of healthcare services by enabling chatbots to handle routine or simple tasks and allowing human healthcare providers to focus on more complex cases. However, there are also some drawbacks to this approach. Firstly, implementing a handoff system could be costly and require additional personnel to handle the handoff process. Secondly, the patient experience could be negatively impacted when the non-functioning handoff process leads to delays in response times. Besides, there is a potential risk of miscommunication between the chatbot and the human healthcare provider, which could cause errors in diagnosis or treatment.</p><p><strong><em>Other approaches</em></strong></p><p>Other approaches to reduce the effects of safety issues include providing clear disclaimers to users by clarifying chatbots are not a substitute for professional medical advice, monitoring and testing healthcare chatbots regularly and training healthcare providers to use and interact with chatbots.</p><h3><strong>Reflection on Ethical Use of NLP</strong></h3><p>With the rapid growth in NLP over the recent few years, an increasing number of organisations have applied NLP techniques to improve work efficiency, enhance the customer experience and optimise marketing strategies. Some commonly used cases which are perceived as acceptable include:</p><ul><li>Chatbots — used to assist with customer services by answering customers’ queries, completing routine tasks, and ensuring the improvement of customer satisfaction.</li><li>Feedback Analysis — used to analyse the customer’s feedback and generate insights, such as knowing customers’ sentiments about an event and understanding the pros and cons based on product reviews.</li><li>Social Media Monitoring — involved in analysing social media data to get information about companies’ products and services to make improvements or amendments.</li><li>Text Summarisation — used to summarise useful information from long reports or other types of documents which enables a more efficient way to do research and make business decisions.</li><li>Hiring and Recruitment — using techniques of information extraction and named entity recognition to extract candidates’ information during the process of selection, contributing to higher efficiency and cost saving.</li></ul><p>However, organisations may also make some unacceptable use of NLP to achieve their business purposes. One example is that NLP can be used to generate fake news to deceive or manipulate customers aimed to boost business growth and profit. Another example is some companies may utilize NLP to eavesdrop on private conversations or analyse personal data without users’ consent. Additionally, NLP applications could be misused to discriminate against individuals or groups with a certain race, gender, religion or other characteristics in the process of screening job applicants or evaluating loan applications.</p><p>In the long term, the development of NLP applications could cause several concerns around social connection, cultural diversity and innovation. Social connections between people could be weakened with the advancement in conversational AI. Individuals may feel more comfortable to disclose their true feeling with chatbots rather than human friends to avoid any personal judgements or conflicts. Cultural diversity could be undervalued and endangered especially languages. As Ruder (2020) pointed out, there are over 7000 languages spoken worldwide but most NLP research is focused on English. The language models trained with data in English may not reflect the cultural norm, common sense knowledge and values of a specific country or language community (Ruder, 2020). The popularity of NLP applications may attract more people to learn English rather than study their local languages and cultures. Also, users may not be aware of any cultural bias built into the model and thus create misunderstanding of cultures or values in specific regions. In addition, innovation and originality could be discouraged and negatively affected. Since the advent of ChatGPT, we have seen its great impact on changing the way people do research, write and communicate. Admittedly, it is more efficient to use ChatGPT to generate a well-written paragraph than to think by ourselves. Howbeit, people may get used to relying on the tool and be unwilling to learn new knowledge and generate new ideas themselves. More weight could be attached to efficiency and productivity compared to innovation and originality.</p><h3>Conclusion</h3><p>The report consists of three parts including a review of ethical issues in chatbots, an introduction of the approach used for critical summary and detailed discussions on the safety issues of chatbots in the healthcare industry by covering:</p><ul><li>Findings about the safety issues in healthcare chatbots</li><li>Impact of safety issues on key stakeholders such as patients, healthcare providers, chatbot developers and regulatory agencies</li><li>Approaches to counter the effect of safety issues in healthcare services with analysis of pros and cons</li><li>Reflection on the acceptable and unacceptable use of NLP in organisations as well as its potential implication and unintended consequences in the long run.</li></ul><p>The key insights about this report are highlighted in the picture below. Potential improvement and future work of this critical summary are to explore the feasibility of each approach discussed under Critical Analysis and provide practical suggestions in healthcare services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1wK49atgAiCVRmMBjBofaw.png" /><figcaption>Photo by author</figcaption></figure><h3>References</h3><p>[1] Bickmore, T. W., Trinh, H., Olafsson, S., O’Leary, T. K., Asadi, R., Rickles, N. M., &amp; Cruz, R.(2018). Patient and consumer safety risks when using conversational assistants for medical information: An observational study of Siri, Alexa, and Google assistant. <em>Journal of Medical Internet Research</em>, <em>20(9), e11510. </em>https://doi.org/10.2196/11510</p><p>[2] Denecke, K., Abd-Alrazaq, A., &amp; Househ, M. (2021). Artificial intelligence for chatbots in mental health: Opportunities and challenges. <em>Multiple Perspectives on Artificial Intelligence in Healthcare</em>, 115–128. <a href="https://doi.org/10.1007/978-3-030-67303-1_10">https://doi.org/10.1007/978-3-030-67303-1_10</a></p><p>[3] Dietsche, E. (2019, January 21). Consumers don’t fully trust healthcare chatbots, study finds. MedCity News. <a href="https://medcitynews.com/2019/01/consumers-healthcare-chatbots/">https://medcitynews.com/2019/01/consumers-healthcare-chatbots/</a></p><p>[4] George, E. (2023, January 20). <em>ChatGPT for research writing: Game changer or ethical risk? </em>Researcher-Focused Products And Solutions For Your Research Publication Journey | Researcher.Life. <a href="https://researcher.life/blog/article/chatgpt-for-research-writing-game-">https://researcher.life/blog/article/chatgpt-for-research-writing-game-</a> changer-or-ethical-risk/</p><p>[5] Henderson, P., Sinha, K., Angelard-Gontier, N., Ke, N. R., Fried, G., Lowe, R., &amp; Pineau, J. (2018). Ethical challenges in data-driven dialogue systems. <em>Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society</em>, 123-<br> 129. <a href="https://doi.org/10.1145/3278721.3278777">https://doi.org/10.1145/3278721.3278777</a></p><p>[6] Parviainen, J., &amp; Rantala, J. (2021). Chatbot breakthrough in the 2020s? An ethical reflection on the trend of automated consultations in health care. Medicine, Health Care and Philosophy, 25(1), 61–71. <a href="https://doi.org/10.1007/s11019-021-10049-w">https://doi.org/10.1007/s11019-021-10049-w</a></p><p>[7] Preston, R. (2023, January 17). The shortage of US healthcare workers in 2023. Oracle | Cloud Applications and Cloud Platform. <a href="https://www.oracle.com/au/human-capital-management/healthcare-workforce-shortage/">https://www.oracle.com/au/human-capital-management/healthcare-workforce-shortage/</a></p><p>[8] Ruane, E., Birhane, A., &amp; Ventresque, A. (2019, December). <em>Conversational AI: Social and Ethical Considerations</em> [Paper presentation]. AICS — 27th AIAI Irish Conference on Artificial Intelligence and Cognitive Science, Galway, Ireland. <a href="https://www.researchgate.net/publication/337925917_Conversational_AI_Social_and_Ethical_Considerations">https://www.researchgate.net/publication/337925917_Conversational_AI_Social_and_Ethical_Considerations</a></p><p>[9] Ruder, S. (2020, August 3). Why you should do NLP beyond English. ruder.io. <a href="https://www.ruder.io/nlp-beyond-english/">https://www.ruder.io/nlp-beyond-english/</a></p><p>[10] Tarapara, K. (2023, February 10). What is the difference between ChatGPT and search engines | Bosc tech labs. BOSC Tech Labs. <a href="https://bosctechlabs.com/chatgpt-vs-search-engine/">https://bosctechlabs.com/chatgpt-vs-search-engine/</a></p><p>[11] Venkataraman, S., &amp; Arunima, S. (2020, December). Chatbots RESET A Framework for Governing Responsible Use of Conversational AI in Healthcare. World Economic Forum. <a href="https://www3.weforum.org/docs/WEF_Governance_of_Chatbots_in_Healthcare_2020.pdf">https://www3.weforum.org/docs/WEF_Governance_of_Chatbots_in_Healthcare_2020.pdf</a></p><p>[12] World Economic Forum. (2020, December 7). <em>Chatbots RESET: A framework for governing responsible use of conversational AI in healthcare</em>. <a href="https://www.weforum.org/reports/chatbots-reset-a-framework-for-governing-responsible-use-of-conversational-ai-in-healthcare/">https://www.weforum.org/reports/chatbots-reset-a-framework-for-governing-responsible-use-of-conversational-ai-in-healthcare/</a></p><p>[13] Zhou, J., Arshad, S. Z., Luo, S., &amp; Chen, F. (2017). Effects of uncertainty and cognitive load on user trust in predictive decision making. <em>Human-Computer Interaction — INTERACT 2017</em>, 23–39. <a href="https://doi.org/10.1007/978-3-319-68059-0_2">https://doi.org/10.1007/978-3-319-68059-0_2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0bfc6ba6273" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Analysis for Bestselling Books]]></title>
            <link>https://medium.com/@amyyang-syd/data-analysis-for-bestselling-books-500b2a3c0b03?source=rss-1ad7fe15bc03------2</link>
            <guid isPermaLink="false">https://medium.com/p/500b2a3c0b03</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[bestsellers]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Amy Yang]]></dc:creator>
            <pubDate>Sat, 22 Jan 2022 11:02:43 GMT</pubDate>
            <atom:updated>2022-01-26T06:52:15.249Z</atom:updated>
            <content:encoded><![CDATA[<h4>Insights discovered by using SQL</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aHrtduCyxM0lvtsa1Y7Ulg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@reneefisherandco?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Renee Fisher</a> on <a href="https://unsplash.com/s/photos/bookstore?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Walking into a book store, our attention is always caught by the bestselling books. Have you ever wondered about similar questions like below?</p><ul><li>Which books were ranked on the bestseller over multiple years?</li><li>Who are the authors of these books?</li><li>Are these books with a high rating and a large number of reviews?</li><li>…</li></ul><p>In this article, we will look at the dataset <a href="https://www.kaggle.com/sootersaalu/amazon-top-50-bestselling-books-2009-2019">Amazon top 50 Bestselling Books 2009–2019</a>, ask some interesting questions from different aspects of bestsellers, and find out the answers with SQL analysis. The SQL query covered here includes:</p><ul><li>Select…From…</li><li>Group by</li><li>Where and Having</li><li>Order by</li><li>Limit</li><li>Join and Union</li><li>Aggregations</li><li>Case statement</li><li>Common Table Expression (CTE)</li><li>Analytic functions</li></ul><p>For SQL syntax details, you could refer to the <a href="https://www.w3schools.com/sql/default.asp">link</a>.</p><h3>Dataset</h3><p>The <a href="https://www.kaggle.com/sootersaalu/amazon-top-50-bestselling-books-2009-2019">dataset</a> is made up of 7 measures: Name, Author, User Rating, Reviews, Price, Year, and Genre. Reviews represent the number of written reviews on Amazon and Year stands for the Year(s) the book ranked on the bestseller. Genre is either fiction or non-fiction. The first 10 records are extracted and included in the table below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2FshrrvzG6kneUVHQVd&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2FshrrvzG6kneUVHQVd&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/d87044da920c6e3c7cb9ca556e59c468/href">https://medium.com/media/d87044da920c6e3c7cb9ca556e59c468/href</a></iframe><h3>Questions and Findings</h3><p>To make it easier for us to come up with a question, the measures are assigned into three groups:</p><ul><li>relating to the book itself: Name, Price, Year and Genre</li><li>relating to the author(s) of the book: Author</li><li>relating to the feedback from the readers of the book: User Rating, Reviews</li></ul><p>We then focus on each group and ask questions from these three perspectives.</p><h4>Book Itself 📚</h4><p><strong><em>Number of books</em></strong></p><p>Firstly we would like to know how many books were listed as top 50 bestsellers from 2009 to 2019. As there may be some books ranked on the bestseller for multiple years, DISTINCT is used to count the number of unique books in the query below. As shown in the result, there are 350 books in total.</p><pre>SELECT count(DISTINCT name)total_number<br>FROM bestsellers;</pre><pre><strong>Result:</strong><br>+--------------+<br>| total_number |<br>+==============+<br>|          350 |<br>+--------------+</pre><p>Among these books, can we know how many of them are fiction and nonfiction respectively? Yes, we can use GROUP BY genre or GROUP BY 1 to split the books into two groups and count the number of unique books for each group. Note that number 1 could replace ‘genre’ in the GROUP BY statement as ‘genre’ is the first column in the SELECT statement. We could see that 160 books are fiction and the other 190 ones are nonfiction.</p><pre>SELECT genre, count(DISTINCT name) number_of_books<br>FROM bestsellers<br>GROUP BY 1;</pre><pre><strong>Result:</strong><br>+-------------+------------------+<br>|    genre    |  number_of_books |<br>+=============+==================+<br>| Fiction     |              160 |<br>| Non Fiction |              190 |<br>+-------------+------------------+</pre><p><strong><em>Books ranked on the bestsellers more than one year</em></strong></p><p>If we add up the top 50 books for 11 years (2009–2019), we should get 550 in total. Since there are only 350 instead, there must be some books ranked as bestsellers over multiple years. What are these books? Which genre do they belong to? To find out the answer, we could use the GROUP BY clause for both book name and genre and count the number of years that the books were ranked on the bestseller. HAVING statement ensures only the result satisfying the criteria is returned. In this case, only the books being bestsellers for more than one year will be filtered in. ORDER BY is used to sort the exported data in descending order by 3rd column (number_of_years) and then in ascending order by 1st column (name). By default, the order will be ascending and thus ASC can be omitted after number 1.</p><pre>SELECT name, genre, count(&quot;Year&quot;) number_of_years<br>FROM bestsellers<br>GROUP BY 1,2<br>HAVING count(&quot;Year&quot;)&gt;=2<br>ORDER BY 3 DESC,1;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2FshrZUbICUDR9YcRk9&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2FshrZUbICUDR9YcRk9&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/5da3b6017086e81ffb68500d180afb65/href">https://medium.com/media/5da3b6017086e81ffb68500d180afb65/href</a></iframe><p>As shown in the table above, 95 books are being ranked in the top 50 bestsellers for multiple years. Could we know how many of them were ranked for 2 years? Are there more fiction books being ranked for 2 years than nonfiction ones? Here we could use Method 1 Common Table Expression (CTE) to name the result of the temporary table ‘more_than_1year’ and then refer to this table in SELECT…FROM…statement and GROUP BY number_of_years and genre to count the books. The result could also be achieved by using Method 2 Subquery.</p><pre><strong>Method 1 - CTE</strong></pre><pre>WITH more_than_1year AS (<br>SELECT name, genre, count(&quot;Year&quot;) number_of_years<br>FROM bestsellers<br>GROUP BY name, genre<br>HAVING count(&quot;Year&quot;)&gt;=2<br>)</pre><pre>SELECT number_of_years, genre, count(*) number_of_books<br>FROM more_than_1year<br>GROUP BY 1,2<br>ORDER BY 1 DESC,2;</pre><pre>-----------------------------------------------------------</pre><pre><strong>Method 2 - Subquery</strong></pre><pre>SELECT number_of_years, genre, count(*) number_of_books<br>FROM (<br>SELECT name, genre, count(&quot;Year&quot;) number_of_years<br>FROM bestsellers<br>GROUP BY name, genre<br>HAVING count(&quot;Year&quot;)&gt;=2<br>) AS more_than_1year<br>GROUP BY 1,2<br>ORDER BY 1 DESC,2;</pre><p>The result is as below:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2FshroIXeJfgbvbz3Fb&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2FshroIXeJfgbvbz3Fb&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/59b491d2249b3a3375d56d03ade48a78/href">https://medium.com/media/59b491d2249b3a3375d56d03ade48a78/href</a></iframe><p>A graph is made to provide a better visualization to compare the fiction and nonfiction books by the number of years they were ranked on the bestseller. It is found that more nonfiction books were ranked as bestsellers for over 4 years compared to fiction books.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rd_MWl7CNgZWZ5gKYnq22Q.png" /><figcaption>Picture by the author</figcaption></figure><p><strong><em>Price Summary</em></strong></p><p>We may wonder what the price of bestselling books looks like. What is the minimum or maximum price? Do fiction and nonfiction books differ a lot in the average price? By using the aggregate function such as MIN(), MAX(), AVG(), we could calculate the minimum, maximum and average price respectively. Median is calculated as the 50th percentile by using the PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY NUM_VALUE) suggested by <a href="https://wiki.postgresql.org/wiki/Aggregate_Median#:~:text=To%20get%20the%20median%20in,distribution%2C%20from%20the%20lower%20half.">Postgresql wiki</a>. Note this is only applied to calculate the median in Postgresql. For BigQuery users, this <a href="https://www.pascallandau.com/bigquery-snippets/calculate-median/">article</a> explains how the median is calculated in detail.</p><pre>SELECT<br>genre,<br>min(price) min_price,<br>max(price) max_price,<br>round(avg(price),2) mean_price,<br>PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY price) median_price<br>FROM<br>bestsellers<br>GROUP BY 1;</pre><pre><strong>Result:</strong><br>+-------------+-----------+-----------+------------+--------------+<br>|    genre    | min_price | max_price | mean_price | median_price |<br>+=============+===========+===========+============+==============+<br>| Fiction     |         0 |        82 |      10.85 |            9 |<br>| Non Fiction |         0 |       105 |      14.84 |           12 |<br>+-------------+-----------+-----------+------------+--------------+</pre><p>As the result shows, both fiction and nonfiction bestselling books could be without a cost. What are these books? We could use the WHERE statement and add the criteria ‘price = 0’ to extract the free books only.</p><pre>SELECT genre, name, author, &quot;Year&quot;, price<br>FROM bestsellers<br>WHERE price = 0<br>ORDER BY 1,2,4</pre><p>In the query statements above, first of all, the minimum price is calculated and then the books with the minimum price are extracted. Is it possible for us to combine these two steps into one query? The answer is Yes!</p><p>One solution is to use CTE and Join together. In the query below, firstly CTE is used to keep the result of the minimum price by each genre with the table named ‘min_price’. This table is then joined with the original table ‘bestsellers’ to extract the information of those free books including name, author, the year ranked on the bestseller, and its price. To make the query a bit shorter, aliases ‘m’ and ‘b’ are used to stand for table ‘min_price’ and ‘bestsellers’ respectively. We can see the book ‘To Kill a Mockingbird’ is listed 4 times and this is because the book was a bestseller for multiple years (2013–2016). To get a unique list of books with minimum price, we can use the GROUP BY clause with columns ‘genre’ and ‘name’ in the query.</p><pre>WITH min_price AS<br>(SELECT genre, min(price) min_price<br>FROM<br>bestsellers<br>GROUP BY<br>genre)</pre><pre>SELECT m.genre, b.name, b.author, b.&quot;Year&quot;, b.price<br>FROM min_price m LEFT JOIN bestsellers b<br>ON m.genre=b.genre AND m.min_price=b.price<br>ORDER BY 1,2,4</pre><p>The result is as below:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2Fshr6xubGWStVTSqfE&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2Fshr6xubGWStVTSqfE&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/f3b430dc7d7ff8bc7ed9635051dc0223/href">https://medium.com/media/f3b430dc7d7ff8bc7ed9635051dc0223/href</a></iframe><p><strong><em>Price distribution</em></strong></p><p>Can we have a brief idea about how the prices are distributed, similar to a histogram? Yes, we can!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2Fshre7OVrcB2HlzWyR&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2Fshre7OVrcB2HlzWyR&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/359e134dbd8cca8c27f687553020a634/href">https://medium.com/media/359e134dbd8cca8c27f687553020a634/href</a></iframe><p>As each of the books in the table above has 2 or more prices, first of all, a temporary table ‘books_with_median_price’ is created to make sure each book has a unique price by using its median price. Then we allocate the prices into four groups: 0, 0–20, 20–40, and 40+ and count the number of books for each price group. Two different methods are used below to achieve the same result.</p><pre><strong>Method 1 - Case statement</strong></pre><pre>WITH books_with_median_price AS(<br>SELECT name, <br>PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY price) price<br>FROM bestsellers<br>GROUP BY name<br>)</pre><pre>SELECT<br>CASE WHEN price =0 THEN &#39;0&#39;<br>WHEN price &gt;0 AND price&lt;=20 THEN &#39;0-20&#39;<br>WHEN price &gt;20 AND price&lt;=40 THEN &#39;20-40&#39;<br>ELSE &#39;40+&#39; END AS price_range,<br>count(name) count<br>FROM books_with_median_price<br>GROUP BY price_range<br>ORDER BY price_range;</pre><pre>-----------------------------------------------------------------</pre><pre><strong>Method 2 - Union</strong></pre><pre>WITH books_with_median_price AS(<br>SELECT name, <br>PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY price) price<br>FROM bestsellers<br>GROUP BY name<br>)</pre><pre>SELECT <br>&#39;0&#39;AS price_range,<br>count(name) AS Count<br>FROM books_with_median_price<br>WHERE price=0<br>UNION (<br>SELECT &#39;0-20&#39; AS price_range,<br>count(name) AS Count<br>FROM books_with_median_price<br>WHERE price&gt;0 AND price&lt;=20<br>)<br>UNION (<br>SELECT<br>&#39;20-40&#39; AS price_range,<br>count(name) AS Count<br>FROM books_with_median_price<br>WHERE price&gt;20 AND price&lt;=40<br>)<br>UNION (<br>SELECT<br>&#39;40+&#39; AS price_range,<br>count(name) AS Count<br>FROM books_with_median_price<br>WHERE price&gt;40)<br>ORDER BY price_range;</pre><pre><strong>Result:</strong><br>+-------------+-------+<br>| price_range | count |<br>+=============+=======+<br>| 0           |     9 |<br>| 0-20        |   301 |<br>| 20-40       |    33 |<br>| 40+         |     7 |<br>+-------------+-------+</pre><p>As the result reveals above, over 88% of bestselling books are sold at a price equal to or below 20.</p><h4><strong>The author(s) of the book ✍</strong></h4><p><strong><em>Author with the most bestselling books</em></strong></p><p>We wonder who is the author having the most bestselling books within the period 2009–2019. The query below will help us find the answer. We use GROUP BY and COUNT(DISTINCT name) to find the number of bestselling books for each author and then sort the number from largest to smallest with ORDER BY 2 DESC. This is followed by statement LIMIT 1 which extracts the top row as the returned result. Based on our analysis, <a href="https://en.wikipedia.org/wiki/Jeff_Kinney">Jeff Kinney</a> has the most books on Amazon’s Top 50 bestsellers during the period.</p><pre>SELECT author, count(DISTINCT name) number_of_books<br>FROM bestsellers<br>GROUP BY 1<br>ORDER BY 2 DESC<br>LIMIT 1;</pre><pre><strong>Result:</strong><br>+-------------+-----------------+<br>|   author    | number_of_books |<br>+=============+=================+<br>| Jeff Kinney |              12 |<br>+-------------+-----------------+</pre><p>What about his books? Which of them were on the bestseller? In the query below, we use the previous query in the WHERE clause to extract the bestselling books that were written by Jeff.</p><pre>SELECT name, &quot;Year&quot;, genre, price, author<br>FROM bestsellers<br>WHERE author =<br>(<br>SELECT author<br>FROM bestsellers<br>GROUP BY 1<br>ORDER BY count(DISTINCT name) DESC<br>LIMIT 1<br>)<br>ORDER BY 2,1</pre><p>The result is as below:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2FshrDXi3V5brR0R9UK&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2FshrDXi3V5brR0R9UK&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/d60f91d9faaf03889c29d09d669ac61f/href">https://medium.com/media/d60f91d9faaf03889c29d09d669ac61f/href</a></iframe><h4><strong>The feedback from the readers of the book 👀</strong></h4><p><strong><em>Highest rating for each author and rating variance among their books</em></strong></p><p>Do authors with bestselling books have a consistent rating? What is the highest rating for each author? We can figure out the answer by using the Analytic function MAX() with an OVER clause which includes three parts:</p><ul><li>PARTITION BY clause divides the rows of table ‘bestsellers’ by author</li><li>ORDER BY clause sorts the records in each partition using Year in ascending order</li><li>ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING is a window frame clause which means all rows in the partition are used for calculation. In our case, all the books with the same author are considered to calculate the highest rating.</li></ul><pre>WITH max_rating AS (<br>SELECT author,<br>name, <br>&quot;Year&quot;, <br>&quot;User Rating&quot;, <br>max(&quot;User Rating&quot;) OVER (PARTITION BY author ORDER BY &quot;Year&quot; <br>ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS max_rating<br>FROM bestsellers<br>ORDER BY 5 DESC,1)</pre><pre>SELECT *, <br>&quot;User Rating&quot;-max_rating AS rating_variance<br>FROM max_rating<br>ORDER BY 5 DESC,1;</pre><p>The result is as below:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2FshryQoSBSfmhgdfuX&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2FshryQoSBSfmhgdfuX&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/40fe6aaf5f71d513ff876d46227be3b7/href">https://medium.com/media/40fe6aaf5f71d513ff876d46227be3b7/href</a></iframe><p>We could see that the rating is as high as 4.9 for a few books such as Little Blue Truck written by Alice Schertle, Humans of New York by Brandon Stanton, etc. If the export is sorted by column rating_variance in ascending order, we could see that the rating of books for the same author can be 0 to 1.6 below their highest-rated books.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2Fshrz88EJbIsUxf36p&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2Fshrz88EJbIsUxf36p&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/0310eed13ff8668d256c52eee09c011e/href">https://medium.com/media/0310eed13ff8668d256c52eee09c011e/href</a></iframe><p>It is discovered that authors have a relatively consistent rating for their bestselling books during the years 2009–2019. This is mainly because numbers of books were ranked on the bestsellers for multiple years and that all the same books have an identical rating except the following two books:</p><ul><li>The 7 Habits of Highly Effective People: Powerful Lessons in Personal Change</li><li>The 5 Love Languages: The Secret to Love that Lasts</li></ul><p>These two books can be identified using the query below.</p><pre>SELECT name<br>FROM bestsellers<br>GROUP BY 1<br>HAVING count(DISTINCT &quot;User Rating&quot; )&gt;1<br>ORDER BY 1</pre><p><strong><em>Books with top 10 reviews each year</em></strong></p><p>What are the books with the most reviews each year? For example, top 10 books based on the number of reviews. The following query applies the Analytic function RANK() with an OVER clause including:</p><ul><li>PARTITION BY clause dividing the rows of table ‘bestseller’ by Year; and</li><li>ORDER BY clause sorting the records in each partition by reviews in descending order</li></ul><p>The rank of each book by the number of reviews is recorded in the new column ‘rank_of_reviews’. The WHERE clause filters the rank ranging from 1 to 10 so that only the books with top 10 reviews are captured each year.</p><pre>WITH top10_reviews AS(<br>SELECT <br>&quot;Year&quot;,<br>name,<br>author,<br>reviews,<br>RANK() OVER (<br>PARTITION BY &quot;Year&quot;<br>ORDER BY reviews DESC<br>) AS rank_of_reviews<br>FROM bestsellers<br>)</pre><pre>SELECT *<br>FROM top10_reviews<br>WHERE rank_of_reviews BETWEEN 1 AND 10<br>ORDER BY 1 DESC,5</pre><p>The result is as below:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2Fshr9rg6YCU7FNo8bO&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2Fshr9rg6YCU7FNo8bO&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/790cf010e4bba4315fff77c3935e1a03/href">https://medium.com/media/790cf010e4bba4315fff77c3935e1a03/href</a></iframe><h3><strong>Conclusion</strong></h3><p>By using SQL analysis, we succeeded in finding the answers to our questions about bestselling books and discovering some interesting insights on its price, genre, author, rating, reviews, and so on. Feel free to share the questions you are interested in regarding bestsellers and your solution to tackle the questions. Hope you enjoy reading this article. Appreciate any feedback!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=500b2a3c0b03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Big Data and Artificial Intelligence in Mental Health]]></title>
            <link>https://medium.com/trends-in-data-science/big-data-and-artificial-intelligence-in-mental-health-336ff591aec9?source=rss-1ad7fe15bc03------2</link>
            <guid isPermaLink="false">https://medium.com/p/336ff591aec9</guid>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Amy Yang]]></dc:creator>
            <pubDate>Mon, 17 May 2021 06:47:36 GMT</pubDate>
            <atom:updated>2021-05-17T06:47:36.303Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>The rapid growth of big data and artificial intelligence (AI) is seen to create great potential for the mental health industry. The development of big data and AI makes it possible to collect, analyse and interpret digital data in mental health. Big data is utilised to capture healthcare data from various sources including electronic health records, wearable tracking devices, genetic testing, and others (Beam &amp; Kohane, 2018). Once the data from diverse sources are prepared and organised, AI will be used to recognise the pattern of datasets, work on generalizations and make predictions for future outcomes (Kamran Ul haq et al., 2020). As summarised by Shatte et al. (2019, p.1435), the application of big data and AI (especially machine learning) will improve the development of mental health in four key domains including “(i) detection and diagnosis of mental health conditions; (ii) prognosis, treatment and support; (iii) public health; and (iv) research and clinical administration”.</p><h3><strong>Challenges in Mental Heath</strong></h3><p>Mental health problems have been common worldwide. According to the World Health Organization (2001), one in four people will experience mental health conditions in their lives. Based on the 2017 study for the Global Burden of Disease, there are around 264 million and 284 million people affected by depression and anxiety respectively around the world (GBD 2017 Disease and Injury Incidence and Prevalence Collaborators, 2018). The prevalence of mental health issues calls for more attention to the main challenges within the development of mental health services and innovative solutions to tackle these challenges.</p><p>One of the key challenges in mental health is the detection of mental illnesses or disorders (Saravia et al., 2016). This challenge has been reflected in detecting depressive disorder which is one of the main mental illnesses causing disability across the globe (World Health Organization, 2019). According to Guntuku et al. (2017), only around 50% of patients with depression have been detected by primary care practitioners. The same challenge also exists in the detection of suicide risks (Roy,2020). As pointed out by Roy (2020), roughly 60%-70% of patients with suicide risks may not be identified by primary care physicians. The low detection of mental illness is most likely related to the existing stigma in society. As indicated by Heim et al. (2018, p.2) “Mental health-related stigma is a key barrier to mental health care”. People with mental health conditions are frequently affected by social bias and discrimination (Martínez &amp; Farhan, 2019). The social stigma may inhibit individuals with mental illness from disclosing their authentic feelings and thoughts to primary care practitioners. Several innovative approaches have been discussed in papers and research on how to improve the detection of mental illnesses (Shatte et al., 2019). Further details about these approaches are discussed in the following section.</p><p>Diagnosis of mental illness is considered as another key challenge in mental health. As suggested by Martínez and Farhan (2019), symptoms for mental health disorders may not be straightforward and may overlap among different diagnoses. This is commonly seen in diagnosing unusual and rare mental disorders. Bellak (1985) believed that around 10% of all cases of schizophrenia (and also affective psychosis) should be diagnosed as the little-known mental disorder category “attention-deficit disorder psychosis (ADD psychosis)”, which has some unique features different from those of the schizophrenic syndrome. To improve the diagnostic accuracy for mental health disorders, a wide range of observable cues are required to be measured reliably regarding cognition, behavior, sociality, and biological patterns (Liang, 2019). However, no reliable data of observables are available for diagnostic assessment at present and the diagnosis of mental illness is still largely based on the assessments from clinical interviews and self-reports (Liang, 2019). Besides, the self-reports may not be reliable enough for diagnostic assessment. As discovered by Atkinson (1997), the rating for self-reports may be biased by affective state and impacted by poor awareness and life events lately. To provide valuable clinical evidence for the diagnosis of mental health conditions, Liang (2019) proposed several data sources for mental health including smartphones and wearable devices, social media, electronic health records, medication records, and a great number of unstructured records.</p><h3><strong>Improving Detection and Diagnosis of Mental Health Problems with Big Data and Artificial Intelligence</strong></h3><p>Emerging big data analytics and AI present opportunities to overcome the barriers in detecting and diagnosing mental health problems. The great potential has been identified in the following data sources for mental health with the application of big data analytics and AI.</p><p><strong>Social Media</strong></p><p>Self-disclosure in social media has become increasingly common these days. As pointed out by Balani and De Choudhury (2015), high self-disclosure was found in posts shared on different mental health forums on Reddit. These self-disclosed data may help to increase our understanding of users’ behaviours and emotions and detect the mental health problems of some users who may not be willing to disclose their true feelings to physicians.</p><p>The methodologies of natural language processing (NLP) and machine learning (ML) create the possibilities to detect mental health disorders on social media data. As suggested by Ismail et al. (2019), NLP techniques enabled several features to be derived from the written text on social media including personality, demographic data and mental status. Sentiment analysis is one of the popular tools to extract features on social media and applied to understand a user’s emotional state (Wongkoblap et al. 2017). Apart from sentiment analysis, other approaches for feature extraction include N-gram, and Linguistic Inquiry and Word Count (LIWC) (Ismail et al. 2019). After being extracted and selected, the features are fed to the ML algorithms to build a predictive model, which is used to detect mental health problems via social media (Wongkoblap et al. 2017). Recent studies have been worked on this area. Reece and Danforth (2017) applied ML tools to detect users’ depression with their Instagram photos. Mitchell et al. (2015) discovered significant linguistic signals to identify schizophrenia suffers on Twitter by using NLP and ML techniques.</p><p><strong>Smartphones and Wearables</strong></p><p>Nowadays, smartphones and wearable devices are widely used to monitor individuals’ physical activities and health conditions including step count, heart rate, sleeping hours, and so on. With the advancements in big data and ML techniques, these data could be collected and analysed to reduce the inaccurate detection of mental health illness due to the lack of shared information by patients with clinical practitioners. This opportunity is presented in the research by Gjoreski et al. (2017) where 70% of stress events were detected with a precision of 95% from the data collected by a wrist device including acceleration, blood volume pulse, electrodermal activity, heart rate, inter-beat interval, and skin temperature. During this study, a context-based stress detector was developed by using ML techniques.</p><p>Opportunities are also being identified in the diagnosis of mental disorders with the utilisation of big data and AI. Specific features of mental health illness could be recognised with ML techniques from the data collected by smartphones and wearables. These features may act as supportive clinical evidence to increase diagnostic accuracy. As indicated by Faurholt-Jepsen et al. (2019), ‘objective smartphone data may represent a potential diagnostic behavioural marker in bipolar disorder and may be a candidate supplementary method to the diagnostic process in the future.’ Within their study, ML techniques were applied to calculate the classification accuracy of objective smartphone data including the number of calls and text messages per day, the duration of phone calls per day and the amount of time the smartphone screen was ‘on’ per day.</p><p><strong>Electronic Health Records (EHRs) and Other Medical Records</strong></p><p>EHRs are considered an important data source in healthcare systems (Liang, 2019). NLP techniques have been employed on EHRs to detect mental health problems. Downs et al. (2017) proposed an NLP approach to detect suicidality in EHRs of adolescents with autism spectrum disorders where NLP tools were used to extract the documents with suicidality related (SR) mentions and classify the documents/patients of SR positive and SR negative. Other records like clinical notes and conversations for counselling sessions also heavily rely on the application of NLP to be analysed due to the unstructured text (Graham et al., 2019). Analysis of these records (including EHRs, clinical notes etc.) will allow for a better understanding of symptoms for mental health problems, which may help to overcome the challenge in diagnosing mental illness with overlapping features. Based on the project carried out by Jackson et al. (2016), fifty symptoms of severe mental illness (schizophrenia, schizoaffective disorder, and bipolar disorder) were identified from clinical EHR text with NLP techniques.</p><h3><strong>Potential Issues Ahead</strong></h3><p>As discussed in the previous section, the application of big data analytics and AI has created great opportunities to improve the detection and diagnosis of mental health problems. At the same time, several potential issues inherent in the implementation of these opportunities are also drawing our attention.</p><p>The quality of data collected from diverse sources could be one of the main concerns. The data could lack reliability. For example, data from social media are likely to include accounts either duplicate, malicious, or otherwise ‘fake’ (Monteith et al., 2015). Sometimes clinical notes from patients’ interviews could also be unreliable. As explained by Halford (2020), due to the existing stigma of mental health problems, patients may have a concern about how the data related to their mental health problems are used and may not be honest to their therapists. Besides, the size of data may be not big enough to optimize the potential of ML. As Kamran Ul haq (2020) pointed out, ML models predict more accurate outcomes through getting trained by more input data with distinct features. However, as mentioned earlier, some mental disorders could be unusual and rare. The data from some rare mental disorders could be small and may lead to inaccurate results. Moreover, fragmentation of data could be challenging. As indicated by Hidalgo‐Mazzei et al. (2016), the fragmented market of smartphones and wearable devices is problematic and unaddressed. The market of smartphones includes various mobile operating systems (such as Android, iOS, Windows Phone, Blackberry, etc.) and wearable devices are provided by more than 20 different companies.</p><p>Ethical issues emerging from big data analytics and AI should also be considered. As the mental health data include a lot of sensitive information (such as depression, suicide attempts, previous history of abortions, etc.), software companies that collect these personal data should guarantee the data are stored safely and protect them from cybersecurity risks. Also, clear policies should be established by companies and institutions to determine who is authorised to access these data (Passos et al., 2019). As suggested by Passos et al. (2019, p.163), ‘physical and remote access to stored data may also give an individual opportunity of duplicating a data set and releasing this information’. Besides, to protect patient’s privacy, the mental health data used by health research should be anonymized (Russ et al., 2019).</p><h3><strong>Conclusion</strong></h3><p>In this paper, we discuss two main challenges in mental health — detection and diagnosis of mental health problems and describe the great opportunities presented by big data analytics and AI in overcoming these challenges. Along with these innovative approaches is the concern for potential issues in both data quality and ethics. This paper is currently limited and further research is required to support the benefit of these opportunities.</p><h3><strong>References</strong></h3><p>Atkinson, M., Zibin, S., &amp; Chuang, H. (1997). Characterizing quality of life among patients with chronic mental illness: a critical examination of the self-report methodology. <em>The American Journal of Psychiatry</em>, <em>154</em>(1), 99–105. <a href="https://doi.org/10.1176/ajp.154.1.99">https://doi.org/10.1176/ajp.154.1.99</a></p><p>Balani, S., &amp; De Choudhury, M. (2015). Detecting and Characterizing Mental Health Related Self-Disclosure in Social Media. Proceedings of the 33rd Annual ACM Conference Extended Abstracts on Human Factors in Computing Systems, 1373–1378. <a href="https://doi.org/10.1145/2702613.2732733">https://doi.org/10.1145/2702613.2732733</a></p><p>Beam, A., &amp; Kohane, I. (2018). Big Data and Machine Learning in Health Care. <em>JAMA : the Journal of the American Medical Association</em>, <em>319</em>(13), 1317–1318. <a href="https://doi.org/10.1001/jama.2017.18391">https://doi.org/10.1001/jama.2017.18391</a></p><p>Bellak, L. (1985). ADD Psychosis as a Separate Entity. <em>Schizophrenia Bulletin</em>, <em>11</em>(4), 523–527. <a href="https://doi.org/10.1093/schbul/11.4.523">https://doi.org/10.1093/schbul/11.4.523</a></p><p>Claudia Martínez, &amp; Imogen Farhan. (2019). <em>Making the right choices: Using data-driven technology to transform mental healthcare</em>. Reform. <a href="https://reform.uk/research/making-right-choices-using-data-driven-technology-transform-mental-healthcare">https://reform.uk/research/making-right-choices-using-data-driven-technology-transform-mental-healthcare</a></p><p>Downs, J., Velupillai, S., George, G., Holden, R., Kikoler, M., Dean, H., Fernandes, A., &amp; Dutta, R. (2017). Detection of Suicidality in Adolescents with Autism Spectrum Disorders: Developing a Natural Language Processing Approach for Use in Electronic Health Records. In Advances in Printing and Media Technology (Vol. 2017, p. 641–)</p><p>Faurholt-Jepsen, M., Busk, J., Þórarinsdóttir, H., Frost, M., Bardram, J., Vinberg, M., &amp; Kessing, L. (2019). Objective smartphone data as a potential diagnostic marker of bipolar disorder. <em>Australian and New Zealand Journal of Psychiatry</em>, <em>53</em>(2), 119–128. <a href="https://doi.org/10.1177/0004867418808900">https://doi.org/10.1177/0004867418808900</a></p><p>GBD 2017 Disease and Injury Incidence and Prevalence Collaborators. (2018). Global, regional, and national incidence, prevalence, and years lived with disability for 354 diseases and injuries for 195 countries and territories, 1990–2017: a systematic analysis for the Global Burden of Disease Study 2017. <em>Global Health Metrics</em>, <em>392</em>(10159), 1789–1858. <a href="https://doi.org/10.1016/S0140-6736(18)32279-7">https://doi.org/10.1016/S0140-6736(18)32279-7</a></p><p>Graham, S., Depp, C., Lee, E., Nebeker, C., Tu, X., Kim, H., &amp; Jeste, D. (2019). Artificial Intelligence for Mental Health and Mental Illnesses: an Overview. <em>Current Psychiatry Reports</em>, <em>21</em>(11), 1–18. <a href="https://doi.org/10.1007/s11920-019-1094-0">https://doi.org/10.1007/s11920-019-1094-0</a></p><p>Gjoreski, M., Luštrek, M., Gams, M., &amp; Gjoreski, H. (2017). Monitoring stress with a wrist device using context. <em>Journal of Biomedical Informatics</em>, <em>73</em>, 159–170. <a href="https://doi.org/10.1016/j.jbi.2017.08.006">https://doi.org/10.1016/j.jbi.2017.08.006</a></p><p>Guntuku, S., Yaden, D., Kern, M., Ungar, L., &amp; Eichstaedt, J. (2017). Detecting depression and mental illness on social media: an integrative review. <em>Current Opinion in Behavioral Sciences</em>, <em>18</em>, 43–49. <a href="https://doi.org/10.1016/j.cobeha.2017.07.005">https://doi.org/10.1016/j.cobeha.2017.07.005</a></p><p>Halford, E. A. (2020, November 14). <em>Data science in mental health</em>. Medium. <a href="https://towardsdatascience.com/data-science-in-mental-health-ccd09ba2148a">https://towardsdatascience.com/data-science-in-mental-health-ccd09ba2148a</a></p><p>Heim, E., Kohrt, B., Koschorke, M., Milenova, M., &amp; Thornicroft, G. (2018). Reducing mental health-related stigma in primary health care settings in low- and middle-income countries: a systematic review. <em>Epidemiology and Psychiatric Sciences</em>, <em>29</em>, e3–e3. <a href="https://doi.org/10.1017/S2045796018000458">https://doi.org/10.1017/S2045796018000458</a></p><p>Hidalgo‐Mazzei, D., Murru, A., Reinares, M., Vieta, E., &amp; Colom, F. (2016). Big Data in mental health: a challenging fragmented future. <em>World Psychiatry</em>, <em>15</em>(2), 186–187. <a href="https://doi.org/10.1002/wps.20307">https://doi.org/10.1002/wps.20307</a></p><p>Ismail, N., Du, M., &amp; Hu, X. (2019). Social Media and Psychological Disorder. In <em>Social Web and Health Research</em> (pp. 171–192). Springer International Publishing. <a href="https://doi.org/10.1007/978-3-030-14714-3_9">https://doi.org/10.1007/978-3-030-14714-3_9</a></p><p>Jackson, R., Patel, R., Jayatilleke, N., Kolliakou, A., Ball, M., Gorrell, G., Roberts, A., Dobson, R., &amp; Stewart, R. (2017). Natural language processing to extract symptoms of severe mental illness from clinical text: the Clinical Record Interactive Search Comprehensive Data Extraction (CRIS-CODE) project. BMJ Open, 7(1), e012012–e012012. <a href="https://doi.org/10.1136/bmjopen-2016-012012">https://doi.org/10.1136/bmjopen-2016-012012</a></p><p>Kamran Ul haq, A., Khattak, A., Jamil, N., Naeem, M., &amp; Mirza, F. (2020). Data Analytics in Mental Healthcare. Scientific Programming, 2020, 1–9. <a href="https://doi.org/10.1155/2020/2024160">https://doi.org/10.1155/2020/2024160</a></p><p>Liang, Y., Zheng, X., &amp; Zeng, D. (2019). A survey on big data-driven digital phenotyping of mental health. <em>Information Fusion</em>, <em>52</em>, 290–307. <a href="https://doi.org/10.1016/j.inffus.2019.04.001">https://doi.org/10.1016/j.inffus.2019.04.001</a></p><p><em>Mental health and development targeting people with mental health conditions as a vulnerable group.</em> (2010). World Health Organization.</p><p>Mitchell M, Hollingshead K, Coppersmith G. Quantifying the language of schizophrenia in social media. In: Proceedings of the 2nd workshop on Computational linguistics and clinical psychology: From linguistic signal to clinical reality. 2015. p. 11–20.</p><p>Monteith, S., Glenn, T., Geddes, J., &amp; Bauer, M. (2015). Big data are coming to psychiatry: a general introduction. <em>International Journal of Bipolar Disorders</em>, <em>3</em>(1), 1–11. <a href="https://doi.org/10.1186/s40345-015-0038-9">https://doi.org/10.1186/s40345-015-0038-9</a></p><p>Passos, I., Mwangi, B., &amp; Kapczinski, F. (2019). <em>Personalized Psychiatry: Big Data Analytics in Mental Health</em>. Springer International Publishing AG.</p><p>Reece, A., &amp; Danforth, C. (2017). Instagram photos reveal predictive markers of depression. <em>EPJ Data Science</em>, <em>6</em>(1), 1–12. <a href="https://doi.org/10.1140/epjds/s13688-017-0110-z">https://doi.org/10.1140/epjds/s13688-017-0110-z</a></p><p>Roy, A., Nikolitch, K., McGinn, R., Jinah, S., Klement, W., &amp; Kaminsky, Z. (2020). A machine learning approach predicts future risk to suicidal ideation from social media data. NPJ Digital Medicine, 3(1), 78–78. <a href="https://doi.org/10.1038/s41746-020-0287-6">https://doi.org/10.1038/s41746-020-0287-6</a></p><p>Russ, T., Woelbert, E., Davis, K., Hafferty, J., Ibrahim, Z., Inkster, B., John, A., Lee, W., Maxwell, M., McIntosh, A., &amp; Stewart, R. (2019). How data science can advance mental health research. <em>Nature Human Behaviour</em>, <em>3</em>(1), 24–32. <a href="https://doi.org/10.1038/s41562-018-0470-9">https://doi.org/10.1038/s41562-018-0470-9</a></p><p>Saravia, E., Chang, C., De Lorenzo, R., &amp; Chen, Y. (2016). MIDAS: mental illness detection and analysis via social media. <em>Proceedings of the 2016 IEEE/ACM International Conference on Advances</em></p><p><em>in Social Networks Analysis and Mining</em>, 1418–1421.</p><p><a href="https://doi.org/10.1109/ASONAM.2016.7752434">https://doi.org/10.1109/ASONAM.2016.7752434</a></p><p>Shatte, A., Hutchinson, D., &amp; Teague, S. (2019). Machine learning in mental health: a scoping review of methods and applications. <em>Psychological Medicine</em>, <em>49</em>(9), 1426–1448. <a href="https://doi.org/10.1017/S0033291719000151">https://doi.org/10.1017/S0033291719000151</a></p><p>Stewart, R., &amp; Davis, K. (2016). “Big data” in mental health research: current status and emerging possibilities. <em>Social Psychiatry and Psychiatric Epidemiology</em>, <em>51</em>(8), 1055–1072. <a href="https://doi.org/10.1007/s00127-016-1266-8">https://doi.org/10.1007/s00127-016-1266-8</a></p><p>Wongkoblap, A., Vadillo, M., &amp; Curcin, V. (2017). Researching Mental Health Disorders in the Era of Social Media: Systematic Review. <em>Journal of Medical Internet Research</em>, <em>19</em>(6), e228–e228. <a href="https://doi.org/10.2196/jmir.7215">https://doi.org/10.2196/jmir.7215</a></p><p>World Health Organization. (2001, September 28). <em>The world health report 2001: Mental disorders affect one in four people</em>. WHO | World Health Organization. <a href="https://www.who.int/news/item/28-09-2001-the-world-health-report-2001-mental-disorders-affect-one-in-four-people">https://www.who.int/news/item/28-09-2001-the-world-health-report-2001-mental-disorders-affect-one-in-four-people</a></p><p>World Health Organization. (2019, November 28). <em>Mental disorders</em>. WHO | World Health Organization. <a href="https://www.who.int/news-room/fact-sheets/detail/mental-disorders">https://www.who.int/news-room/fact-sheets/detail/mental-disorders</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=336ff591aec9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/trends-in-data-science/big-data-and-artificial-intelligence-in-mental-health-336ff591aec9">Big Data and Artificial Intelligence in Mental Health</a> was originally published in <a href="https://medium.com/trends-in-data-science">Trends in Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>