From e779c01853370871304c47113f501c5627d874fe Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 26 Aug 2016 15:24:35 -0600 Subject: [PATCH] Update README for Natural Language [refs #828] --- README.md | 33 +++++++++ google-cloud-language/README.md | 67 +++++++++++++++++++ .../lib/google/cloud/language.rb | 2 +- 3 files changed, 101 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 286d7a02294f..3d8760f64d83 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ This project supports the following Google Cloud Platform services: * [Cloud Datastore](#datastore) * [Cloud DNS](#dns) * [Stackdriver Logging](#logging) +* [Cloud Natural Language API](#natural-language) * [Cloud Pub/Sub](#pubsub) * [Cloud Resource Manager](#resource-manager) * [Cloud Storage](#storage) @@ -202,6 +203,38 @@ entry.resource.labels[:version_id] = "20150925t173233" logging.write_entries entry ``` +### Natural Language + +- [google-cloud-language README](google-cloud-language/README.md) +- [google-cloud-language API documentation](http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-language) +- [google-cloud-language on RubyGems](https://rubygems.org/gems/[google-cloud-language) +- [Google Cloud Natural Language API documentation](https://cloud.google.com/language/docs) + +#### Quick Start + +```sh +$ gem install google-cloud-language +``` + +#### Preview + +```ruby +require "google/cloud" + +gcloud = Google::Cloud.new +language = gcloud.language + +content = "Darth Vader is the best villain in Star Wars." +document = language.document content +annotation = document.annotate + +annotation.sentiment.polarity #=> 1.0 +annotation.sentiment.magnitude #=> 0.8999999761581421 +annotation.entities.count #=> 2 +annotation.sentences.count #=> 1 +annotation.tokens.count #=> 10 +``` + ### Pub/Sub - [google-cloud-pubsub README](google-cloud-pubsub/README.md) diff --git a/google-cloud-language/README.md b/google-cloud-language/README.md index de61bcb294ab..35bdb20fa23e 100644 --- a/google-cloud-language/README.md +++ b/google-cloud-language/README.md @@ -1 +1,68 @@ # google-cloud-language + +[Google Cloud Natural Language API](https://cloud.google.com/language/) ([docs](https://cloud.google.com/language/docs)) reveals the structure and meaning of text by offering powerful machine learning models in an easy to use REST API. You can use it to extract information about people, places, events and much more, mentioned in text documents, news articles or blog posts. You can use it to understand sentiment about your product on social media or parse intent from customer conversations happening in a call center or a messaging app. You can analyze text uploaded in your request or integrate with your document storage on Google Cloud Storage. + +The Google Cloud Natural Language API is currently a beta release, and might be changed in backward-incompatible ways. It is not subject to any SLA or deprecation policy and is not intended for real-time usage in critical applications. + +- [google-cloud-language API documentation](http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-language/google/cloud/language) +- [google-cloud-language on RubyGems](https://rubygems.org/gems/google-cloud-language) +- [Google Cloud Natural Language API documentation](https://cloud.google.com/language/docs) + +## Quick Start + +```sh +$ gem install google-cloud-language +``` + +## Authentication + +This library uses Service Account credentials to connect to Google Cloud services. When running on Compute Engine the credentials will be discovered automatically. When running on other environments the Service Account credentials can be specified by providing the path to the JSON file, or the JSON itself, in environment variables. + +Instructions and configuration options are covered in the [Authentication Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-language/guides/authentication). + +## Example + +```ruby +require "google/cloud" + +gcloud = Google::Cloud.new +language = gcloud.language + +content = "Darth Vader is the best villain in Star Wars." +document = language.document content +annotation = document.annotate + +annotation.sentiment.polarity #=> 1.0 +annotation.sentiment.magnitude #=> 0.8999999761581421 +annotation.entities.count #=> 2 +annotation.sentences.count #=> 1 +annotation.tokens.count #=> 10 +``` + +## Supported Ruby Versions + +This library is supported on Ruby 2.0+. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +It is currently in major version zero (0.y.z), which means that anything may change at any time and the public API should not be considered stable. + +## Contributing + +Contributions to this library are always welcome and highly encouraged. + +See the [Contributing Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/guides/contributing) for more information on how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct](../CODE_OF_CONDUCT.md) for more information. + +## License + +This library is licensed under Apache 2.0. Full license text is available in [LICENSE](../LICENSE). + +## Support + +Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues). +Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com). + diff --git a/google-cloud-language/lib/google/cloud/language.rb b/google-cloud-language/lib/google/cloud/language.rb index b57560e4eb38..58f71324f2d5 100644 --- a/google-cloud-language/lib/google/cloud/language.rb +++ b/google-cloud-language/lib/google/cloud/language.rb @@ -19,7 +19,7 @@ module Google module Cloud ## - # # Google Cloud Natural Language + # # Google Cloud Natural Language API # # Google Cloud Natural Language API reveals the structure and meaning of # text by offering powerful machine learning models in an easy to use REST