Permalink
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (34 sloc) 639 Bytes
metadata:
title: Predict
example start: 2
example end: 4
documentation: "https://docassemble.org/docs/ml.html#predicting"
---
modules:
- docassemble.base.util
---
question: |
Enter some text.
fields:
- no label: phrase
---
mandatory: True
code: |
ml = SimpleTextMachineLearner(group_id='demo')
predictions = ml.predict(phrase)
---
mandatory: True
question: |
The prediction
subquestion: |
The text provided was:
> ${ phrase }
% if len(predictions):
The prediction was:
> ${ predictions[0] }
% else:
There is not enough training data
to make a prediction yet.
% endif
buttons:
- Restart: restart