Skip to content

Commit 45a323f

Browse files
committed
added README.md sample output
1 parent b2eaa02 commit 45a323f

File tree

1 file changed

+91
-5
lines changed

1 file changed

+91
-5
lines changed

language/api/README.md

Lines changed: 91 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ where `<command>` is one of: `entities`, `sentiment`, or `syntax`.
3838

3939
The script will write to STDOUT the json returned from the API for the requested feature.
4040

41-
For example, if you run:
41+
* Example1:
4242

4343
```sh
4444
$ python analyze.py entities "Tom Sawyer is a book written by a guy known as Mark Twain."
@@ -50,38 +50,124 @@ You will see something like the following returned:
5050
{
5151
"entities": [
5252
{
53-
"salience": 0.49785897,
53+
"salience": 0.50827783,
5454
"mentions": [
5555
{
5656
"text": {
5757
"content": "Tom Sawyer",
5858
"beginOffset": 0
59-
}
59+
},
60+
"type": "PROPER"
6061
}
6162
],
6263
"type": "PERSON",
6364
"name": "Tom Sawyer",
6465
"metadata": {
66+
"mid": "/m/01b6vv",
6567
"wikipedia_url": "http://en.wikipedia.org/wiki/The_Adventures_of_Tom_Sawyer"
6668
}
6769
},
6870
{
69-
"salience": 0.12209519,
71+
"salience": 0.22226454,
72+
"mentions": [
73+
{
74+
"text": {
75+
"content": "book",
76+
"beginOffset": 16
77+
},
78+
"type": "COMMON"
79+
}
80+
],
81+
"type": "WORK_OF_ART",
82+
"name": "book",
83+
"metadata": {}
84+
},
85+
{
86+
"salience": 0.18305534,
87+
"mentions": [
88+
{
89+
"text": {
90+
"content": "guy",
91+
"beginOffset": 34
92+
},
93+
"type": "COMMON"
94+
}
95+
],
96+
"type": "PERSON",
97+
"name": "guy",
98+
"metadata": {}
99+
},
100+
{
101+
"salience": 0.086402282,
70102
"mentions": [
71103
{
72104
"text": {
73105
"content": "Mark Twain",
74106
"beginOffset": 47
75-
}
107+
},
108+
"type": "PROPER"
76109
}
77110
],
78111
"type": "PERSON",
79112
"name": "Mark Twain",
80113
"metadata": {
114+
"mid": "/m/014635",
81115
"wikipedia_url": "http://en.wikipedia.org/wiki/Mark_Twain"
82116
}
83117
}
84118
],
85119
"language": "en"
86120
}
87121
```
122+
123+
* Example2:
124+
125+
```sh
126+
$ python analyze.py entities "Apple has launched new iPhone."
127+
```
128+
129+
You will see something like the following returned:
130+
131+
```
132+
{
133+
"entities": [
134+
{
135+
"salience": 0.72550339,
136+
"mentions": [
137+
{
138+
"text": {
139+
"content": "Apple",
140+
"beginOffset": 0
141+
},
142+
"type": "PROPER"
143+
}
144+
],
145+
"type": "ORGANIZATION",
146+
"name": "Apple",
147+
"metadata": {
148+
"mid": "/m/0k8z",
149+
"wikipedia_url": "http://en.wikipedia.org/wiki/Apple_Inc."
150+
}
151+
},
152+
{
153+
"salience": 0.27449661,
154+
"mentions": [
155+
{
156+
"text": {
157+
"content": "iPhone",
158+
"beginOffset": 23
159+
},
160+
"type": "PROPER"
161+
}
162+
],
163+
"type": "CONSUMER_GOOD",
164+
"name": "iPhone",
165+
"metadata": {
166+
"mid": "/m/027lnzs",
167+
"wikipedia_url": "http://en.wikipedia.org/wiki/IPhone"
168+
}
169+
}
170+
],
171+
"language": "en"
172+
}
173+
```

0 commit comments

Comments
 (0)