This is nlp sandbox with using slack messages. There are some functions bellow.
- Generate Wordcloud image each user
- Generate Wordcloud weekly or monthly image
- Vectorize the content of each user's post and save as KVS
- Recommend users who are interested in a given word
- Get messages via Slack API (require: API key)
- Basic preparation
- cleaning
- morphological analysis
- normalization
- stop words removal
- Visualization
- Wordcloud
- Feature embedding
- Word2vec
- Doc2vec
- Weighting factor
- tf-idf
- Similarity search
- with Word2vec
- with Doc2vec
- with Elasticsearch
- ... etc
- install Docker
- Get Slack API key
- channels api
- users api
Save as nlpslack/data/conf/credentials.json
{
"channel_api_key": "YOUR_CHANNELS_API_KEY",
"user_api_key": "YOUR_USERS_API_KEY"
}
$ docker-compose up -d
$ docker exec -it nlpslack python nlpslack/main.py [opt]
$ docker exec -it nlpslack bash
$ docker exec -it nlpslack python nlpslack/main.py wc u
Then you can find wordcloud images in (docker)dev/nlpslack/data/wc_by_usr
# Generate Wordcloud weekly image
$ docker exec -it nlpslack python nlpslack/main.py wc t --term w
# Generate Wordcloud monthly image
$ docker exec -it nlpslack python nlpslack/main.py wc t --term m
Then you can find wordcloud images in (docker)dev/nlpslack/data/wc_by_term
$ docker exec -it nlpslack python nlpslack/main.py vec -o KVS_PATH
Then you can find KVS file ( *.json ) in KVS_PATH
default KVS_PATH : (docker)dev/nlpslack/data/content_features.json
require: (3) is done
If execute, I show recommended user's name and similarity score.
$ docker exec -it nlpslack python nlpslack/main.py search --word SAMPLE
$ Recommended users are bellow ...
$ Key word: "SAMPLE"
$ 1. User03: 0.8799
$ 2. User11: 0.7653
$ 3. User05: 0.3442
$ docker exec -it nlpslack python nlpslack/main.py -h