Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added simple usage for NLP package to ReadMe #114

Merged
merged 4 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,31 @@ ax[1] = vis.radar(df, ax=ax[1], color='C1', alpha=0)
<img src="examples/radar.svg">
</p>

## 5. NLP Package Usage

## 5. Command Line Interface
### 5.1 Add Sentiment

```python
from chatminer.nlp import add_sentiment

df_with_sentiment = add_sentiment(df)
```
### 5.2 Stacked Bar Chart:Sentiment per Day of the Week

```python
grouped = df_with_sentiment.groupby(['weekday', 'sentiment']).size().unstack(fill_value=0)
ax = grouped.plot(kind='bar', stacked=True, figsize=(10, 6), colormap=plt.cm.get_cmap('Set3'))
ax.set(xlabel='Day of the Week', ylabel='Count', title='Sentiment per Day of the Week')
ax.legend(title='Sentiment', loc='upper right')
plt.show()
```

<p align="center">
<img src="examples/stacked_bar_chart.png">
</p>


## 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.

Expand Down
Binary file added examples/stacked_bar_chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.