chat-miner
chat-miner copied to clipboard
Parsers and visualizations for chats
Getting your data
As of now, only WhatsApp chats are supported. Steps to export a WhatsApp chat:
- Go to the app
- Go to Settings/Chats/Chat History
- Tap Export chat
- Select the chat you want to export
Parsing the chatfile
The following code uses the WhatsAppParser
module to:
- Read a chatfile
- Infer its datetime format
- Parse its content into a DataFrame
- Add additonal metadata columns
from chatminer.chatparsers import WhatsAppParser
parser = WhatsAppParser(FILEPATH)
parser.parse_file_into_df()
print(parser.df.describe())
Creating Visualizations
Sunburst Chart
import chatminer.visualizations as vis
vis.sunburst(parser.df)
Wordcloud
import chatminer.visualizations as vis
stopwords = ['media', 'omitted', 'missed', 'voice', 'call']
vis.wordcloud(parser.df, stopwords)