Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Hironsan committed Aug 31, 2017
1 parent 25b450d commit 8c718d0
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ x_test, y_test = load_data_and_labels(test_path)
After reading the data, prepare preprocessor and pre-trained word embeddings:
```python
p = prepare_preprocessor(x_train, y_train)
p.save(os.path.join(SAVE_ROOT, 'preprocessor.pkl'))

embeddings = load_word_embeddings(p.vocab_word, embedding_path, model_config.word_embedding_size)
model_config.vocab_size = len(p.vocab_word)
model_config.char_vocab_size = len(p.vocab_char)
```

Expand Down Expand Up @@ -108,10 +107,6 @@ Evaluator performs evaluation.
Prepare an instance of Evaluator class and give test data to eval method:

```
p = WordPreprocessor.load(os.path.join(SAVE_ROOT, 'preprocessor.pkl'))
model_config.vocab_size = len(p.vocab_word)
model_config.char_vocab_size = len(p.vocab_char)
weights = os.path.join(SAVE_ROOT, 'model_weights.h5')
evaluator = anago.Evaluator(model_config, weights, save_path=SAVE_ROOT, preprocessor=p)
Expand All @@ -127,12 +122,7 @@ After evaluation, F1 value is output:
To tag any text, we can use ***Tagger***.
Prepare an instance of Tagger class and give text to tag method:
```
p = WordPreprocessor.load(os.path.join(SAVE_ROOT, 'preprocessor.pkl'))
model_config.vocab_size = len(p.vocab_word)
model_config.char_vocab_size = len(p.vocab_char)
weights = os.path.join(SAVE_ROOT, 'model_weights.h5')
tagger = anago.Tagger(model_config, weights, save_path=SAVE_ROOT, preprocessor=p)
```

Expand Down

0 comments on commit 8c718d0

Please sign in to comment.