Uh oh!
There was an error while loading. Please reload this page.
Adding usage doc for Natural Language API. - #2062
Conversation
| and each method uses a `Document`_ for representing text. To | ||
| create a :class:`~gcloud.language.document.Document`, | ||
| .. code-block:: python |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
tseaver
commented
Aug 8, 2016
A couple of more general questions:
|
| app. You can analyze text uploaded in your request or integrate | ||
| with your document storage on Google Cloud Storage. | ||
| This is a Beta release of Google Cloud Natural Language API. This |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
commented
Aug 17, 2016
@tseaver Can you weigh in here on which response values you think we should wrap? |
elibixby
commented
Aug 18, 2016
@jerjou Can you take a look to make sure we have someone who has used the API a bit to comment on usability. |
tseaver
commented
Aug 18, 2016
For forentityindocument.analyze_entities():
build_entity_link(entity.name, entity.type, entity.url)For defby_sentiment(document):
"""Sort key: rank from most negative to most positive."""sentiment=document.analyze_sentiment()
returnsentiment.polarity*sentiment.magnituderanked=sorted(documents, key=by_sentiment)For only_syntax=document.annotate_text(
include_entities=False, include_sentiment=False)
assertonly_syntax.entitiesisNoneassertonly_syntax.sentimentisNonetree=ParseTree() # imagined class w/ 'add_token' method.forindex, tokeninenumerate(only_syntax.tokens):
edge=token.dependency_edgetree.add_token(
index, token.lemma, token.part_of_speech, edge.head_index, edge.label) |
| >>> document = client.document(text_content) | ||
| By default, the document's language and type are English and | ||
| plain text: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
tseaver
commented
Aug 22, 2016
LGTM. |
dhermes
commented
Aug 22, 2016
cdb4adf to
d36ad4dCompare| .. code-block:: python | ||
| >>> client = language.Client(language='es', | ||
| ... encoding=encoding=language.Encoding.UTF16) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* feat: support pandas.Index as key for DataFrame.__setitem__() * fix format
/cc @omaray are you in the org yet (I can't assign you to this PR)