diff --git a/README.md b/README.md index 63f10f3..3a471ec 100644 --- a/README.md +++ b/README.md @@ -103,8 +103,28 @@ ax[1] = vis.radar(df, ax=ax[1], color='C1', alpha=0)

+## 5. Natural Language Processing -## 5. Command Line Interface +### 5.1 Add Sentiment + +```python +from chatminer.nlp import add_sentiment + +df_sentiment = add_sentiment(df) +``` +### 5.2 Example Plot: Sentiment per Author in Groupchat + +```python +df_grouped = df_sentiment.groupby(['author', 'sentiment']).size().unstack(fill_value=0) +ax = df_grouped.plot(kind='bar', stacked=True, figsize=(8, 3)) +``` + +

+ +

+ + +## 6. Command Line Interface The CLI supports parsing chat logs into csv files. As of now, you **can't** create visualizations from the CLI directly. diff --git a/examples/nlp.svg b/examples/nlp.svg new file mode 100644 index 0000000..11fa55e --- /dev/null +++ b/examples/nlp.svg @@ -0,0 +1,982 @@ + + + + + + + + 2023-11-04T23:46:50.732974 + image/svg+xml + + + Matplotlib v3.7.1, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +