-
Notifications
You must be signed in to change notification settings - Fork 822
update nlc examples to use new method signatures #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,12 @@ | |
|
|
||
| # create a classifier | ||
| # with open('../resources/weather_data_train.csv', 'rb') as training_data: | ||
| # print(json.dumps(natural_language_classifier.create( | ||
| # training_data=training_data, name='weather'), indent=2)) | ||
| # metadata = json.dumps({'name': 'my-classifier', 'language': 'en'}) | ||
| # classifier = natural_language_classifier.create_classifier( | ||
| # metadata=metadata, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be training_metadata now, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gotcha, cool cool |
||
| # training_data=training_data | ||
| # ) | ||
| # print(json.dumps(classifier, indent=2)) | ||
|
|
||
| status = natural_language_classifier.get_classifier(classifier_id) | ||
| print(json.dumps(status, indent=2)) | ||
|
|
@@ -30,10 +34,10 @@ | |
| 'tomorrow?') | ||
| print(json.dumps(classes, indent=2)) | ||
|
|
||
| # delete = natural_language_classifier.remove('2374f9x68-nlc-2697') | ||
| # delete = natural_language_classifier.delete_classifier('2374f9x68-nlc-2697') | ||
| # print(json.dumps(delete, indent=2)) | ||
|
|
||
| # example of raising a ValueError | ||
| # print(json.dumps( | ||
| # natural_language_classifier.create(training_data='', name='weather3'), | ||
| # natural_language_classifier.create_classifier(training_data='', name='weather3'), | ||
| # indent=2)) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason why these are commented out? are the examples run with some sort of CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@germanattanasio ☝️
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the examples serve double-duty as they are used as integration tests. You can see this in the
test/test_examples.pymodule.