Skip to content

Commit

Permalink
Add output to readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Jan 31, 2021
1 parent b6d07f3 commit 019b302
Show file tree
Hide file tree
Showing 2 changed files with 235 additions and 52 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ The following outlines using kwx to derive keywords from a text corpus with `pro
from kwx.utils import prepare_data
from kwx.model import extract_kws

input_language = "english"
num_keywords = 10
input_language = "english" # see kwx.languages for options
num_keywords = 15
num_topics = 10
ignore_words = ["words", "user", "knows", "they", "don't", "want"]

Expand Down Expand Up @@ -110,6 +110,23 @@ bert_kws = extract_kws(
)
```

```
The BERT keywords are:
['time', 'flight', 'plane', 'southwestair', 'ticket', 'cancel', 'united', 'baggage',
'love', 'virginamerica', 'service', 'customer', 'delay', 'late', 'hour']
Are there words that should be removed [y/n]? y
Type or copy word(s) to be removed: southwestair, united, virginamerica
The new BERT keywords are:
['late', 'baggage', 'service', 'flight', 'time', 'love', 'book', 'customer',
'response', 'hold', 'hour', 'cancel', 'cancelled_flighted', 'delay', 'plane']
Are there words that should be removed [y/n]? n
```

The model will be re-ran until all words known to be unreasonable are removed for a suitable output. `kwx.model.gen_files` could also be used as a run-all function that produces a directory with a keyword text file and visuals (for experienced users wanting quick results).

# Visuals
Expand Down
Loading

0 comments on commit 019b302

Please sign in to comment.