diff --git a/packages/google-cloud-language/samples/README.md b/packages/google-cloud-language/samples/README.md index a9cde0ccafa..3622506d237 100644 --- a/packages/google-cloud-language/samples/README.md +++ b/packages/google-cloud-language/samples/README.md @@ -111,3 +111,145 @@ For more information, see https://cloud.google.com/natural-language/docs [shell_img]: //gstatic.com/cloudssh/images/open-btn.png [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-language&page=editor&open_in_editor=samples/README.md + +### automlNaturalLanguageDataset + +View the [source code][automlNaturalLanguageDataset_code]. + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-language&page=editor&open_in_editor=samples/automl/automlNaturalLanguageDataset.js,samples/README.md) + +__Usage:__ `node automlNaturalLanguageDataset.js --help` + +``` +automlNaturalLanguageDataset.js + +Commands: + automlNaturalLanguageDataset.js create-dataset creates a new Dataset + automlNaturalLanguageDataset.js list-datasets list all Datasets + automlNaturalLanguageDataset.js get-dataset Get a Dataset + automlNaturalLanguageDataset.js delete-dataset Delete a dataset + automlNaturalLanguageDataset.js import-data Import labeled items into dataset + automlNaturalLanguageDataset.js export-data Export a dataset to a Google Cloud Storage Bucket + +Options: + --version Show version number [boolean] + --computeRegion, -c region name e.g. "us-central1" [string] [default: "us-central1"] + --datasetName, -n Name of the Dataset [string] [default: "testDataSet"] + --datasetId, -i Id of the dataset [string] + --filter, -f Name of the Dataset to search for [string] [default: "text_classification_dataset_metadata:*"] + --multilabel, -m Type of the classification problem, False - MULTICLASS, True - MULTILABEL. + [string] [default: false] + --outputUri, -o URI (or local path) to export dataset [string] + --path, -p URI or local path to input .csv, or array of .csv paths + [string] [default: "gs://nodejs-docs-samples-vcm/flowerTraindataMini.csv"] + --projectId, -z The GCLOUD_PROJECT string, e.g. "my-gcloud-project" [number] [default: "203278707824"] + --help Show help [boolean] + +Examples: + node automlNaturalLanguageDataset.js create-dataset -n "newDataSet" + node automlNaturalLanguageDataset.js list-datasets -f "imageClassificationDatasetMetadata:*" + node automlNaturalLanguageDataset.js get-dataset -i "DATASETID" + node automlNaturalLanguageDataset.js delete-dataset -i "DATASETID" + node automlNaturalLanguageDataset.js import-data -i "dataSetId" -p "gs://myproject/mytraindata.csv" + node automlNaturalLanguageDataset.js export-data -i "dataSetId" -o "gs://myproject/outputdestination.csv" + +For more information, see https://cloud.google.com/natural-language/docs +``` + +[automlNaturalLanguageDataset_docs]: https://cloud.google.com/natural-language/docs/ +[automlNaturalLanguageDataset_code]: automl/automlNaturalLanguageDataset.js + +[shell_img]: //gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-language&page=editor&open_in_editor=samples/README.md + +### automlNaturalLanguageModel + +View the [source code][automlNaturalLanguageModel_code]. + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-language&page=editor&open_in_editor=samples/automl/automlNaturalLanguageModel.js,samples/README.md) + +__Usage:__ `node automlNaturalLanguageModel.js --help` + +``` +analyze.v1beta2.js + +Commands: + automlNaturalLanguageModel.js create-model creates a new Model + automlNaturalLanguageModel.js get-operation-status Gets status of current operation + automlNaturalLanguageModel.js list-models list all Models + automlNaturalLanguageModel.js get-model Get a Model + automlNaturalLanguageModel.js list-model-evaluations List model evaluations + automlNaturalLanguageModel.js get-model-evaluation Get model evaluation + automlNaturalLanguageModel.js display-evaluation Display evaluation + automlNaturalLanguageModel.js delete-model Delete a Model + +Options: + --version Show version number [boolean] + --computeRegion, -c region name e.g. "us-central1" [string] [default: "us-central1"] + --datasetId, -i Id of the dataset [string] + --filter, -f Name of the Dataset to search for [string] [default: ""] + --modelName, -m Name of the model [string] [default: false] + --modelId, -a Id of the model [string] [default: ""] + --modelEvaluationId, -e Id of the model evaluation [string] [default: ""] + --operationFullId, -o Full name of an operation [string] [default: ""] + --projectId, -z The GCLOUD_PROJECT string, e.g. "my-gcloud-project" [number] [default: "203278707824"] + --trainBudget, -t Budget for training the model [string] [default: ""] + --help Show help [boolean] + +Examples: + node automlNaturalLanguageModel.js create-model -i "DatasetID" -m "myModelName" -t "2" + node automlNaturalLanguageModel.js get-operation-status -i "datasetId" -o "OperationFullID" + node automlNaturalLanguageModel.js list-models -f "textClassificationModelMetadata:*" + node automlNaturalLanguageModel.js get-model -a "ModelID" + node automlNaturalLanguageModel.js list-model-evaluations -a "ModelID" + node automlNaturalLanguageModel.js get-model-evaluation -a "ModelId" -e "ModelEvaluationID" + node automlNaturalLanguageModel.js display-evaluation -a "ModelId" + node automlNaturalLanguageModel.js delete-model -a "ModelID" + +For more information, see https://cloud.google.com/natural-language/docs +``` + +[automlNaturalLanguageModel_docs]: https://cloud.google.com/natural-language/docs/ +[automlNaturalLanguageModel_code]: automl/automlNaturalLanguageModel.js + +[shell_img]: //gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-language&page=editor&open_in_editor=samples/README.md + +### automlNaturalLanguagePredict + +View the [source code][automlNaturalLanguagePredict_code]. + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-language&page=editor&open_in_editor=samples/automl/automlNaturalLanguagePredict.js,samples/README.md) + +__Usage:__ `node automlNaturalLanguagePredict.js --help` + +``` +automlNaturalLanguagePredict.js + +Commands: + automlNaturalLanguagePredict.js predict classify the content + +Options: + --version Show version number [boolean] + --computeRegion, -c region name e.g. "us-central1" [string] [default: "us-central1"] + --filePath, -f local text file path of the content to be classified [string] [default: "./resources/test.txt"] + --modelId, -i Id of the model which will be used for text classification [string] + --projectId, -z The GCLOUD_PROJECT string, e.g. "my-gcloud-project" [number] [default: "203278707824"] + --scoreThreshold, -s A value from 0.0 to 1.0. When the model makes predictions for an image it willonly produce + results that have at least this confidence score threshold. Default is .5 + [string] [default: "0.5"] + --help Show help [boolean] + +Examples: + node automlNaturalLanguagePredict.js predict -i "modelId" -f "./resources/test.txt" -s "0.5" + +For more information, see https://cloud.google.com/natural-language/docs +``` + +[automlNaturalLanguagePredict_docs]: https://cloud.google.com/natural-language/docs/ +[automlNaturalLanguagePredict_code]: automl/automlNaturalLanguagePredict.js + +[shell_img]: //gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-language&page=editor&open_in_editor=samples/README.md + + diff --git a/packages/google-cloud-language/samples/package.json b/packages/google-cloud-language/samples/package.json index 20128ae3ef2..68535b645ba 100644 --- a/packages/google-cloud-language/samples/package.json +++ b/packages/google-cloud-language/samples/package.json @@ -11,6 +11,8 @@ "test": "mocha" }, "dependencies": { + "@google-cloud/automl": "^0.1.1", + "mathjs": "^5.1.0", "@google-cloud/language": "^2.0.0", "@google-cloud/storage": "^2.0.0", "yargs": "^12.0.0"