Skip to content

Commit

Permalink
Text2text refactor (#78)
Browse files Browse the repository at this point in the history
* text2text refactor and update robin_hood version
  • Loading branch information
jiong-zhang authored Oct 15, 2021
1 parent b44ff38 commit 4cfb9d5
Show file tree
Hide file tree
Showing 5 changed files with 586 additions and 737 deletions.
2 changes: 1 addition & 1 deletion THIRD-PARTY-LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

------

** Robin Hood Hashing; version 3.9.0 --
** Robin Hood Hashing; version 3.11.3 --
https://github.com/martinus/robin-hood-hashing
Copyright (c) 2018-2019 Martin Ankerl

Expand Down
21 changes: 21 additions & 0 deletions pecos/apps/text2text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,27 @@ python3 -m pecos.apps.text2text.predict \
--predicted-output-item-path ./test-prediction.txt
```
The predictions are saved in the `./test-prediction.txt`.

### Advanced Usage: Train/Pred params via JSON input
`pecos.apps.text2text` supports accepting training and predicting parameters from an input JSON file.
Moreover, `python3 -m pecos.apps.text2text.train` helpfully provide the option to generate all parameters in JSON format to stdout.

You can generate train/pred parameter to `.json` files
with all of the parameters that you can edit and fill in.
```bash
> python3 -m pecos.apps.text2text.train --generate-train-params-skeleton &> train_params.json
> python3 -m pecos.apps.text2text.train --generate-pred-params-skeleton &> pred_params.json
```
After editing the `train_params.json` and `pred_params.json` files, you can do training via:
```bash
> python3 -m pecos.apps.text2text.train \
--input-text-path ./training-data.txt \
--vectorizer-config-path ./config.json \
--output-item-path ./output-labels.txt \
--model-folder ./pecos-text2text-model
--train-params-path train_params.json \
--pred-params-path pred_params.json
```
***

Copyright (2021) Amazon.com, Inc.
Expand Down
Loading

0 comments on commit 4cfb9d5

Please sign in to comment.