aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/examples/eager/spinn/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/examples/eager/spinn/README.md')
-rw-r--r--third_party/examples/eager/spinn/README.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/third_party/examples/eager/spinn/README.md b/third_party/examples/eager/spinn/README.md
index 6bd3d53e56..335c0fa3b5 100644
--- a/third_party/examples/eager/spinn/README.md
+++ b/third_party/examples/eager/spinn/README.md
@@ -66,3 +66,44 @@ Other eager execution examples can be found under [tensorflow/contrib/eager/pyth
```bash
tensorboard --logdir /tmp/spinn-logs
```
+
+- After training, you may use the model to perform inference on input data in
+ the SNLI data format. The premise and hypotheses sentences are specified with
+ the command-line flags `--inference_premise` and `--inference_hypothesis`,
+ respecitvely. Each sentence should include the words, as well as parentheses
+ representing a binary parsing of the sentence. The words and parentheses
+ should all be separated by spaces. For instance,
+
+ ```bash
+ pythons spinn.py --data_root /tmp/spinn-data --logdir /tmp/spinn-logs \
+ --inference_premise '( ( The dog ) ( ( is running ) . ) )' \
+ --inference_hypothesis '( ( The dog ) ( moves . ) )'
+ ```
+
+ which will generate an output like the following, due to the semantic
+ consistency of the two sentences.
+
+ ```none
+ Inference logits:
+ entailment: 1.101249 (winner)
+ contradiction: -2.374171
+ neutral: -0.296733
+ ```
+
+ By contrast, the following sentence pair:
+
+ ```bash
+ pythons spinn.py --data_root /tmp/spinn-data --logdir /tmp/spinn-logs \
+ --inference_premise '( ( The dog ) ( ( is running ) . ) )' \
+ --inference_hypothesis '( ( The dog ) ( rests . ) )'
+ ```
+
+ will give you an output like the following, due to the semantic
+ contradiction of the two sentences.
+
+ ```none
+ Inference logits:
+ entailment: -1.070098
+ contradiction: 2.798695 (winner)
+ neutral: -1.402287
+ ```