Skip to content

Commit 2ec36ec

Browse files
authored
Language samples (GoogleCloudPlatform#845)
* Language samples * Updates to recently published libraries. * Updates to latest client library version. * Moves new production features to v1, updates tests, updates docs.
1 parent bd89eb9 commit 2ec36ec

File tree

10 files changed

+476
-525
lines changed

10 files changed

+476
-525
lines changed

language/analysis/README.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ mvn clean compile assembly:single
3232
```
3333

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

3737
## Basic usage:
3838

3939
```
4040
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
4141
com.google.cloud.language.samples.Analyze \
42-
<entities | sentiment | syntax> \
42+
<entities | entities-sentiment | sentiment | syntax> \
4343
<text | GCS path>
4444
```
4545

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

64+
Analyze entity sentiment
65+
```
66+
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
67+
com.google.cloud.language.samples.Analyze entities-sentiment \
68+
"There's nothing better than searching for ice cream on Google."
69+
```
70+
6471
Analyze syntax
6572
```
6673
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
@@ -92,11 +99,18 @@ java -cp target/language-entities-1.0-jar-with-dependencies.jar \
9299
"Der schnelle braune Fuchs sprang über den faulen Hund."
93100
```
94101

95-
Analyze entity sentiment Beta
102+
Analyze categories in text Beta
96103
```
97104
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
98-
com.google.cloud.language.samples.AnalyzeBeta entities-sentiment \
99-
"There's nothing better than searching for ice cream on Google."
105+
com.google.cloud.language.samples.AnalyzeBeta classify \
106+
"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."
107+
```
108+
109+
Analyze categories in GCS file Beta
110+
```
111+
java -cp target/language-entities-1.0-jar-with-dependencies.jar \
112+
com.google.cloud.language.samples.AnalyzeBeta classify \
113+
"gs://cloud-samples-tests/natural-language/android-text.txt"
100114
```
101115

102116
Run beta demo from *nix or OSX

language/analysis/pom.xml

+1-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ limitations under the License.
3232
<dependency>
3333
<groupId>com.google.cloud</groupId>
3434
<artifactId>google-cloud-language</artifactId>
35-
<version>0.21.1-beta</version>
35+
<version>0.24.0-beta</version>
3636
</dependency>
3737
<dependency>
3838
<groupId>com.google.guava</groupId>
@@ -41,13 +41,6 @@ limitations under the License.
4141
</dependency>
4242
<!-- [END dependencies] -->
4343

44-
<!-- FIXME: remove after client fixes depenency issue -->
45-
<dependency>
46-
<groupId>com.google.auth</groupId>
47-
<artifactId>google-auth-library-oauth2-http</artifactId>
48-
<version>0.7.1</version>
49-
</dependency>
50-
5144
<!-- Test Dependencies -->
5245
<dependency>
5346
<groupId>junit</groupId>

0 commit comments

Comments
 (0)