Software Open Access
Giovanni Spitale;
Federico Germani;
Nikola Biller - Andorno
{ "inLanguage": { "alternateName": "eng", "@type": "Language", "name": "English" }, "description": "<p>The purpose of this tool is performing NLP analysis on Telegram chats. Telegram chats can be exported as .json files from the official client, Telegram Desktop (v. 2.9.2.0). </p>\n\n<p>The files are parsed, the content is used to populate a message dataframe, which is then anonymized. </p>\n\n<p><strong>The software calculates and displays the following information:</strong></p>\n\n<ul>\n\t<li>user count (n of users, new users per day, removed users per day);</li>\n\t<li>message count (n and relative frequency of messages, messages per day);</li>\n\t<li>autocoded messages (anonymized message dataframe with code weights assigned to each message based on a customizable set of regex rules);</li>\n\t<li>prevalence of codes (n and relative frequency);</li>\n\t<li>prevalence of lemmas (n and relative frequency);</li>\n\t<li>prevalence of lemmas segmented by autocode (n and relative frequency);</li>\n\t<li>mean sentiment per day;</li>\n\t<li>mean sentiment segmented by autocode.</li>\n</ul>\n\n<p><strong>The software outputs:</strong></p>\n\n<ul>\n\t<li>messages_df_anon.csv - an anonymized file containing the progressive id of the message, the date, the univocal pseudonym of the sender, and the text;</li>\n\t<li>usercount_df.csv - user count dataframe;</li>\n\t<li>user_activity_df.csv - user activity dataframe;</li>\n\t<li>messagecount_df.csv - message count dataframe;</li>\n\t<li>messages_df_anon_coded.csv - an anonymized file containing the progressive id of the message, the date, the univocal pseudonym of the sender, the text, the codes, and the sentiment;</li>\n\t<li>autocode_freq_df.csv - general prevalence of codes;</li>\n\t<li>lemma_df.csv - lemma frequency;</li>\n\t<li>autocode_freq_df_[rule_name].csv - lemma frequency in coded messages, one file per rule;</li>\n\t<li>daily_sentiment_df.csv - daily sentiment;</li>\n\t<li>sentiment_by_code_df.csv - sentiment segmented by code;</li>\n\t<li>messages_anon.txt - anonymized text file generated from the message data frame, for easy import in other software for text mining or qualitative analysis;</li>\n\t<li>messages_anon_MaxQDA.txt - anonymized text file generated from the message data frame, formatted specifically for MaxQDA (to track speakers and codes).</li>\n</ul>\n\n<p><strong>Dependencies:</strong></p>\n\n<ul>\n\t<li>pandas (1.2.1)</li>\n\t<li>json</li>\n\t<li>random</li>\n\t<li>os</li>\n\t<li>re</li>\n\t<li>tqdm (4.62.2)</li>\n\t<li>datetime (4.3)</li>\n\t<li>matplotlib (3.4.3)</li>\n\t<li>Spacy (3.1.2) + it_core_news_md</li>\n\t<li>wordcloud (1.8.1)</li>\n\t<li>Counter</li>\n\t<li>feel_it (1.0.3)</li>\n\t<li>torch (1.9.0)</li>\n\t<li>numpy (1.21.1)</li>\n\t<li>transformers (4.3.3)</li>\n</ul>\n\n<p><strong>This code is optimized for Italian, however:</strong></p>\n\n<ul>\n\t<li>Lemma analysis is based on spaCy, which provides several other models for other languages ( <a href=\"https://spacy.io/models\">https://spacy.io/models</a> ) so it can easily be adapted.</li>\n\t<li>Sentiment analysis is performed using <a href=\"https://github.com/MilaNLProc/feel-it\">FEEL-IT: Emotion and Sentiment Classification for the Italian Language</a> (Kudos to Federico Bianchi <f.bianchi@unibocconi.it>; Debora Nozza <debora.nozza@unibocconi.it>; and Dirk Hovy <dirk.hovy@unibocconi.it>). Their work is specific for Italian. To perform sentiment analysis in other languages one could consider nltk.sentiment</li>\n</ul>\n\n<p>The code is structured in a Jupyter-lab notebook, heavily commented for future reference.</p>\n\n<p>The software comes with a toy dataset comprised of Wikiquotes copy-pasted in a chat created by the research group. Have fun exploring it.</p>", "license": "https://creativecommons.org/licenses/by/4.0/legalcode", "creator": [ { "affiliation": "University of Zurich - Institute of Biomedical Ethics and History of Medicine", "@id": "https://orcid.org/0000-0002-6812-0979", "@type": "Person", "name": "Giovanni Spitale" }, { "affiliation": "University of Zurich - Institute of Biomedical Ethics and History of Medicine", "@id": "https://orcid.org/0000-0002-5604-0437", "@type": "Person", "name": "Federico Germani" }, { "affiliation": "University of Zurich - Institute of Biomedical Ethics and History of Medicine", "@id": "https://orcid.org/0000-0001-7661-1324", "@type": "Person", "name": "Nikola Biller - Andorno" } ], "url": "https://zenodo.org/record/5534045", "datePublished": "2021-09-28", "version": "1.0.1", "keywords": [ "natural language processing", "NLP", "telegram", "covid-19", "social listening", "green pass", "vaccine", "freedom", "ethics" ], "@context": "https://schema.org/", "identifier": "https://doi.org/10.5281/zenodo.5534045", "@id": "https://doi.org/10.5281/zenodo.5534045", "@type": "SoftwareSourceCode", "name": "The TSL machine: parser, lemma analysis, sentiment analysis and autocoding for Telegram chats" }
All versions | This version | |
---|---|---|
Views | 290 | 275 |
Downloads | 17 | 15 |
Data volume | 63.4 MB | 51.6 MB |
Unique views | 265 | 258 |
Unique downloads | 15 | 15 |