Skip to content
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

Language samples #845

Merged
merged 7 commits into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions language/analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ mvn clean compile assembly:single
```

We can then run the assembled JAR file with the `java` command. The variable $COMMAND takes
three values `entities`, `sentiment`, or `syntax`.
three values `entities`, `entities-sentiment`, `sentiment`, or `syntax`.

## Basic usage:

```
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
com.google.cloud.language.samples.Analyze \
<entities | sentiment | syntax> \
<entities | entities-sentiment | sentiment | syntax> \
<text | GCS path>
```

Expand All @@ -61,6 +61,13 @@ java -cp target/language-entities-1.0-jar-with-dependencies.jar \
"The quick brown fox jumped over the lazy dog."
```

Analyze entity sentiment
```
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
com.google.cloud.language.samples.Analyze entities-sentiment \
"There's nothing better than searching for ice cream on Google."
```

Analyze syntax
```
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
Expand Down Expand Up @@ -92,11 +99,18 @@ java -cp target/language-entities-1.0-jar-with-dependencies.jar \
"Der schnelle braune Fuchs sprang über den faulen Hund."
```

Analyze entity sentiment Beta
Analyze categories in text Beta
```
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
com.google.cloud.language.samples.AnalyzeBeta entities-sentiment \
"There's nothing better than searching for ice cream on Google."
com.google.cloud.language.samples.AnalyzeBeta classify \
"Android is a mobile operating system developed by Google, based on the Linux kernel and designed primarily for touchscreen mobile devices such as smartphones and tablets."
```

Analyze categories in GCS file Beta
```
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
com.google.cloud.language.samples.AnalyzeBeta classify \
"gs://cloud-samples-tests/natural-language/android-text.txt"
```

Run beta demo from *nix or OSX
Expand Down
9 changes: 1 addition & 8 deletions language/analysis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ limitations under the License.
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-language</artifactId>
<version>0.21.1-beta</version>
<version>0.24.0-beta</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand All @@ -41,13 +41,6 @@ limitations under the License.
</dependency>
<!-- [END dependencies] -->

<!-- FIXME: remove after client fixes depenency issue -->
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>0.7.1</version>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
Expand Down
Loading