Skip to content

Commit ef1267b

Browse files
committed
Updated README
1 parent 5476b77 commit ef1267b

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

language/sentiment/README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,32 @@ is located within the documentation.
88
This sample is a simple illustration of how to construct a sentiment analysis
99
request and process a response using the API.
1010

11+
## Prerequisites
12+
13+
1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/), including the [gcloud tool](https://cloud.google.com/sdk/gcloud/), and [gcloud app component](https://cloud.google.com/sdk/gcloud-app).
14+
15+
2. Setup the gcloud tool. This provides authentication to Google Cloud APIs and services.
16+
17+
```
18+
$ gcloud init
19+
```
20+
21+
1122
## Download the Code
1223

1324
```
14-
git clone https://github.com/GoogleCloudPlatform/python-dev-samples/language/sentiment/
25+
$ git clone https://github.com/GoogleCloudPlatform/python-dev-samples/language/sentiment/
26+
$ cd python-docs-samples/language/sentiment
27+
```
28+
29+
## Run the Code
30+
31+
Open a sample folder, create a virtualenv, install dependencies, and run the sample:
32+
33+
```
34+
$ virtualenv env
35+
$ source env/bin/activate
36+
(env)$ pip install -r requirements.txt
1537
```
1638

1739
### Usage
@@ -21,7 +43,6 @@ provide to the sample on the command line. (You can also
2143
pass your own text files.)
2244

2345
```
24-
$ python sentiment_analysis.py textfile.txt
46+
(env)$ python sentiment_analysis.py textfile.txt
2547
Sentiment: polarity of -0.1 with magnitude of 6.7
2648
```
27-

0 commit comments

Comments
 (0)