- Notifications
You must be signed in to change notification settings - Fork 6.6k
migrate code from googleapis/python-language #8533
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
Merged
Merged
Changes from 250 commits
Commits
Show all changes
326 commits Select commit Hold shift + click to select a range
01ff509 Auto-update dependencies. [(#1048)](https://github.com/GoogleCloudPla…
dpebot 58c697a move region tags so that the beta page only include codes from the re…
dizcology 104b4ef Auto-update dependencies. [(#1055)](https://github.com/GoogleCloudPla…
dpebot 0b1a10d Update langauge test case to deal with changing server output
7e10f05 Auto-update dependencies. [(#1057)](https://github.com/GoogleCloudPla…
dpebot 31d3b5b show entity type name [(#1062)](https://github.com/GoogleCloudPlatfor…
dizcology ebba1f8 Auto-update dependencies. [(#1073)](https://github.com/GoogleCloudPla…
dpebot 0ca3eec Fix flaky movie_nl tests
fe9be31 Auto-update dependencies. [(#1093)](https://github.com/GoogleCloudPla…
dpebot 0c39960 Auto-update dependencies. [(#1094)](https://github.com/GoogleCloudPla…
dpebot 530dd43 Language classify [(#1095)](https://github.com/GoogleCloudPlatform/py…
dizcology d73bec2 Client version update [(#1117)](https://github.com/GoogleCloudPlatfor…
dizcology 6ad2fd6 Update all generated readme auth instructions [(#1121)](https://githu…
3114217 Update readme [(#1124)](https://github.com/GoogleCloudPlatform/python…
dizcology 5a64261 Classify tutorial [(#1120)](https://github.com/GoogleCloudPlatform/py…
dizcology f9361c4 Auto-update dependencies. [(#1133)](https://github.com/GoogleCloudPla…
dpebot 3820973 Added Link to Python Setup Guide [(#1158)](https://github.com/GoogleC…
1e2c091 Auto-update dependencies. [(#1138)](https://github.com/GoogleCloudPla…
dpebot 6fd82d1 Fix classify text tutorial
c049a09 Fix classify text tutorial
4433058 Fix a few more lint issues
1a8adf1 Fixed failed tests on Kokoro (Natural Language API) [(#1185)](https:/…
fdefb9c Auto-update dependencies. [(#1186)](https://github.com/GoogleCloudPla…
dpebot 0a0c397 Auto-update dependencies. [(#1199)](https://github.com/GoogleCloudPla…
dpebot 67afd42 Fix linter issue w/ snippets
andrewsg b072af5 Auto-update dependencies. [(#1208)](https://github.com/GoogleCloudPla…
dpebot db96e3a Language v1 [(#1202)](https://github.com/GoogleCloudPlatform/python-d…
dizcology e675b64 update to use v1 client [(#1216)](https://github.com/GoogleCloudPlatf…
dizcology 8e99524 Auto-update dependencies. [(#1217)](https://github.com/GoogleCloudPla…
dpebot b62c6be Relax regex in ocr_nl sample test [(#1250)](https://github.com/Google…
15ecc88 Added "Open in Cloud Shell" buttons to README files [(#1254)](https:/…
31950bd Auto-update dependencies. [(#1304)](https://github.com/GoogleCloudPla…
dpebot 2c9fbb5 Auto-update dependencies. [(#1309)](https://github.com/GoogleCloudPla…
dpebot ea1e3dd Auto-update dependencies. [(#1320)](https://github.com/GoogleCloudPla…
dpebot aaff669 Auto-update dependencies. [(#1355)](https://github.com/GoogleCloudPla…
dpebot 39793ec Auto-update dependencies. [(#1359)](https://github.com/GoogleCloudPla…
dpebot ff89cd3 Auto-update dependencies. [(#1377)](https://github.com/GoogleCloudPla…
dpebot 9205fec Auto-update dependencies. [(#1397)](https://github.com/GoogleCloudPla…
dpebot 58b3511 Auto-update dependencies.
dpebot 207e84f Regenerate the README files and fix the Open in Cloud Shell link for …
a84db3f Update READMEs to fix numbering and add git clone [(#1464)](https://g…
frankyn 1e3de10 automl beta [(#1575)](https://github.com/GoogleCloudPlatform/python-d…
sirtorry 4418193 use lcm instead of vcm [(#1597)](https://github.com/GoogleCloudPlatfo…
sirtorry b3b2fdf skip automl model create/delete test [(#1608)](https://github.com/Goo…
sirtorry 768c811 Language region tag update [(#1643)](https://github.com/GoogleCloudPl…
alixhami 9f72967 Auto-update dependencies. [(#1658)](https://github.com/GoogleCloudPla…
dpebot 9fed94d Update AutoML region tags to use standard product prefixes [(#1669)](…
alixhami fca1973 Add small, generated version of `language_sentiment_text` [(#1660)](h…
beccasaurus 7a99445 Access Display Names of enum fields via enum object [(#1738)](https:/…
beccasaurus dac091d Remove unused and outdated Natural Language samples [(#1715)](https:/…
alixhami 6ebffe8 Fixed name of model [(#1779)](https://github.com/GoogleCloudPlatform/…
engelke 9a80642 Auto-update dependencies. [(#1846)](https://github.com/GoogleCloudPla…
dpebot 2d77d1f Moved the imports and region tags inside the functions [(#1891)](htt…
happyhuman 5fb10cf Fix decode [(#1911)](https://github.com/GoogleCloudPlatform/python-do…
andrewferlitsch e4efe7d Update sample output [(#1893)](https://github.com/GoogleCloudPlatform…
nnegrey e3d396b Auto-update dependencies. [(#1980)](https://github.com/GoogleCloudPla…
dpebot facb890 Update requirements.txt [(#2128)](https://github.com/GoogleCloudPlatf…
engelke f0c43d2 Adds split updates for Firebase ... opencensus [(#2438)](https://gith…
gguuss d94a127 Add Set Endpoint Samples [(#2497)](https://github.com/GoogleCloudPlat…
nnegrey ba3e28f Auto-update dependencies. [(#2005)](https://github.com/GoogleCloudPla…
dpebot 05c86f8 chore(deps): update dependency google-auth to v1.11.2 [(#2724)](https…
leahecole 35d7c27 Update dependency google-cloud-automl to v0.10.0 [(#3033)](https://gi…
renovate-bot bbc7d56 Remove unused region_tag comment. [(#3075)](https://github.com/Google…
jsimonweb 7981a83 Remove Natural Language samples not included docs. [(#3074)](https://…
jsimonweb a907125 langauge: fix old automl tests [(#3089)](https://github.com/GoogleClo…
nnegrey bff0652 chore(deps): update dependency numpy to v1.18.2 [(#3181)](https://git…
renovate-bot e2e92ec Simplify noxfile setup. [(#2806)](https://github.com/GoogleCloudPlatf…
kurtisvg 9049df2 Remove Language sample unused region_tag comments [(#3078)](https://g…
jsimonweb 76b7a4d Update dependency google-auth to v1.14.0 [(#3148)](https://github.com…
renovate-bot 614fc0b chore(deps): update dependency google-api-python-client to v1.8.0 [(#…
renovate-bot 09019d5 chore(deps): update dependency numpy to v1.18.3 [(#3441)](https://git…
renovate-bot ae410f2 remove samples/tests that aren't on devsite, incl. localized docs [(#…
Strykrol 9c3411a Update dependency google-api-python-client to v1.8.2 [(#3452)](https:…
renovate-bot 9e08165 chore(deps): update dependency google-auth to v1.14.1 [(#3464)](https…
renovate-bot 98baf71 chore(deps): update dependency numpy to v1.18.4 [(#3675)](https://git…
renovate-bot 283cde6 chore(deps): update dependency google-auth to v1.14.2 [(#3724)](https…
renovate-bot 6d03155 chore(deps): update dependency google-auth to v1.14.3 [(#3728)](https…
renovate-bot 57909bd update google-auth to 1.15.0 final part [(#3819)](https://github.com/…
leahecole ea986f1 update google-api-python-client to 1.8.3 final part [(#3827)](https:/…
leahecole aa65b6d chore(deps): update dependency google-api-python-client to v1.8.4 [(#…
renovate-bot 6dd04c9 chore(deps): update dependency google-auth to v1.16.0 [(#3903)](https…
renovate-bot 05580f6 chore(deps): update dependency google-api-python-client to v1.9.1 [(#…
renovate-bot 9a4f514 Update dependency numpy to v1.18.5 [(#3954)](https://github.com/Googl…
renovate-bot 2a7a88d final update for google-auth [(#3967)](https://github.com/GoogleCloud…
leahecole b180e92 Update dependency google-api-python-client to v1.9.2 [(#4038)](https:…
renovate-bot 5b4d82a Update dependency google-auth to v1.17.0 [(#4058)](https://github.com…
renovate-bot 7fde490 chore(deps): update dependency google-auth to v1.17.1 [(#4073)](https…
renovate-bot 560cfe6 Update dependency google-auth to v1.17.2 [(#4083)](https://github.com…
renovate-bot e89843c Update dependency google-api-python-client to v1.9.3 [(#4057)](https:…
renovate-bot 1293c8d Update dependency google-auth to v1.18.0 [(#4125)](https://github.com…
renovate-bot 4e64857 chore(deps): update dependency google-cloud-automl to v1 [(#4127)](ht…
renovate-bot a8f7bee chore(deps): update dependency numpy to v1.19.0 [(#4137)](https://git…
renovate-bot d23fae6 Update dependency google-auth-httplib2 to v0.0.4 [(#4255)](https://gi…
renovate-bot 69c4077 chore(deps): update dependency pytest to v5.4.3 [(#4279)](https://git…
renovate-bot ff3886c chore(deps): update dependency google-auth to v1.19.0 [(#4293)](https…
renovate-bot eb8667f Update dependency google-api-python-client to v1.10.0 [(#4302)](https…
renovate-bot d90ac72 chore(deps): update dependency google-auth to v1.19.1 [(#4304)](https…
renovate-bot 32e51e5 chore(deps): update dependency google-auth to v1.19.2 [(#4321)](https…
renovate-bot aaf9937 chore(deps): update dependency numpy to v1.19.1 [(#4351)](https://git…
renovate-bot ccb05ac Update dependency google-auth to v1.20.0 [(#4387)](https://github.com…
renovate-bot 47c5cbf Update dependency pytest to v6 [(#4390)](https://github.com/GoogleClo…
renovate-bot 20e80f9 chore(deps): update dependency google-auth to v1.20.1 [(#4452)](https…
renovate-bot e15fbf7 chore(deps): update dependency google-api-python-client to v1.10.1 [(…
renovate-bot 170b5a3 Update dependency google-auth to v1.21.0 [(#4588)](https://github.com…
renovate-bot 2b42ed8 Update dependency google-api-python-client to v1.11.0 [(#4587)](https…
renovate-bot 2604439 chore(deps): update dependency google-auth to v1.21.1 [(#4634)](https…
renovate-bot d2a2493 chore(deps): update dependency numpy to v1.19.2 [(#4662)](https://git…
renovate-bot ceee0ad chore(deps): update dependency google-auth to v1.21.2 [(#4684)](https…
renovate-bot 0ba09d2 chore: delete automl samples [(#4696)](https://github.com/GoogleCloud…
busunkim96 3f5507f chore(deps): update dependency google-api-python-client to v1.12.1 [(…
renovate-bot 8685b77 chore(deps): update dependency google-auth to v1.21.3 [(#4754)](https…
renovate-bot 55b3069 chore(deps): update dependency google-api-python-client to v1.12.2 [(…
renovate-bot 498813c chore: update templates
hkdevandla 25c46dd feat: Migrate API to use python micro-generator (#41)
hkdevandla bd3f41b chore(deps): update dependency google-auth to v1.22.1 (#45)
renovate-bot 05c4402 fix: adds underscore to "type" to NL API samples (#49)
telpirion 66091a1 chore(deps): update dependency google-api-python-client to v1.12.5 (#44)
renovate-bot 38a7893 chore(deps): update dependency google-cloud-language to v2 (#48)
renovate-bot f80bd63 chore(deps): update dependency google-auth to v1.23.0 (#52)
renovate-bot 7291c06 chore(deps): update dependency numpy to v1.19.4 (#53)
renovate-bot e340975 chore(deps): update dependency google-api-python-client to v1.12.8 (#54)
renovate-bot 191191c chore: update templates (#56)
yoshi-automation d20843b chore(deps): update dependency numpy to v1.19.5 (#67)
renovate-bot bff86e4 chore(deps): update dependency google-auth to v1.24.0 (#65)
renovate-bot 57306c6 chore(deps): update dependency google-auth to v1.25.0 (#73)
renovate-bot 144c629 chore(deps): update dependency google-auth to v1.26.1 (#75)
renovate-bot 796153f chore(deps): update dependency numpy to v1.20.1 (#74)
renovate-bot 1c0612e chore(deps): update dependency google-auth to v1.27.0 (#76)
renovate-bot ee7677e fix: use correct retry deadlines (#83)
yoshi-automation 17b59f6 build: update .OwlBot.lock with new version of post-processor (#95)
gcf-owl-bot[bot] 69d77ce chore(deps): update dependency google-auth-httplib2 to v0.1.0 (#80)
renovate-bot df9369f chore(deps): update dependency pytest to v6.2.4 (#97)
renovate-bot 94c4136 chore(deps): update dependency google-auth to v1.30.0 (#79)
renovate-bot dfdb217 chore(deps): update dependency google-api-python-client to v2 (#81)
renovate-bot d236c1c chore: new owl bot post processor docker image (#115)
gcf-owl-bot[bot] 4e79a6b chore(deps): update dependency google-auth to v1.30.1 (#117)
renovate-bot c414299 chore(deps): update dependency google-api-python-client to v2.6.0 (#118)
renovate-bot 961d6d0 chore(deps): update dependency google-auth to v1.31.0 (#122)
renovate-bot b3044a8 chore(deps): update dependency google-api-python-client to v2.8.0 (#120)
renovate-bot bd356e2 docs: fix typos (#125)
parthea fb564e7 chore(deps): update dependency google-api-python-client to v2.9.0 (#128)
renovate-bot 940c69b chore(deps): update dependency google-cloud-language to v2.1.0 (#130)
renovate-bot 8624ffc chore(deps): update dependency google-api-python-client to v2.10.0 (#…
renovate-bot cd0bd70 chore(deps): update dependency google-auth to v1.32.0 (#137)
renovate-bot d8016d9 chore(deps): update dependency google-cloud-language to v2.2.0 (#146)
renovate-bot 8f9714a chore(deps): update dependency google-api-python-client to v2.11.0 (#…
renovate-bot e0d80af chore(deps): update dependency google-api-python-client to v2.12.0 (#…
renovate-bot 45ee821 chore(deps): update dependency google-auth to v1.32.1 (#145)
renovate-bot ab4601d chore(deps): update dependency google-auth to v1.33.0 (#159)
renovate-bot 58741c3 chore(deps): update dependency google-api-python-client to v2.13.0 (#…
renovate-bot 4944961 feat: add Samples section to CONTRIBUTING.rst (#161)
gcf-owl-bot[bot] f1ed1a5 chore(deps): update dependency google-api-python-client to v2.14.1 (#…
renovate-bot 61a1e3a chore(deps): update dependency google-auth to v1.33.1 (#164)
renovate-bot cc1eb02 chore(deps): update dependency google-cloud-language to v2.2.1 (#165)
renovate-bot 724ef07 chore(deps): update dependency google-api-python-client to v2.15.0 (#…
renovate-bot 6c343fe chore(deps): update dependency google-auth to v1.34.0 (#171)
renovate-bot b908dfb chore(deps): update dependency google-cloud-language to v2.2.2 (#173)
renovate-bot 067a056 chore: fix INSTALL_LIBRARY_FROM_SOURCE in noxfile.py (#175)
gcf-owl-bot[bot] 5aa1f38 chore: drop mention of Python 2.7 from templates (#177)
gcf-owl-bot[bot] 05d0d2c chore(deps): update dependency google-auth to v1.35.0 (#178)
renovate-bot 9b861df chore(deps): update dependency google-auth to v2 (#180)
renovate-bot 84f0d26 chore(deps): update dependency google-api-python-client to v2.18.0 (#…
renovate-bot 067ab33 chore(deps): update dependency pytest to v6.2.5 (#184)
renovate-bot ff987d3 chore(deps): update dependency google-api-python-client to v2.19.0 (#…
renovate-bot a1f999c chore(deps): update dependency google-auth to v2.0.2 (#186)
renovate-bot 5dc0d4f chore(deps): update dependency google-api-python-client to v2.19.1 (#…
renovate-bot d6f5d9a chore: blacken samples noxfile template (#193)
gcf-owl-bot[bot] 32bacdb chore(deps): update all dependencies (#192)
renovate-bot 7824814 chore(deps): update dependency google-auth to v2.2.0 (#197)
renovate-bot 8e06646 chore(deps): update dependency google-api-python-client to v2.23.0 (#…
renovate-bot a906117 chore(deps): update dependency google-auth to v2.2.1 (#199)
renovate-bot 7a775c2 chore: fail samples nox session if python version is missing (#200)
gcf-owl-bot[bot] 7213781 chore(deps): update dependency google-api-python-client to v2.24.0 (#…
renovate-bot 1e135ed chore(python): Add kokoro configs for python 3.10 samples testing (#207)
gcf-owl-bot[bot] e3f9116 chore(deps): update dependency google-auth to v2.3.0 (#206)
renovate-bot 5626a0f chore(deps): update all dependencies (#216)
renovate-bot abf8e46 chore(deps): update dependency google-api-python-client to v2.30.0 (#…
renovate-bot a952f23 chore(python): run blacken session for all directories with a noxfile…
gcf-owl-bot[bot] f17eb0d chore(deps): update dependency google-api-python-client to v2.31.0 (#…
renovate-bot 2675486 chore: updating numpy (#226)
dinagraves a62a587 chore(deps): update dependency google-api-python-client to v2.32.0 (#…
renovate-bot 524badd chore(deps): update dependency google-api-python-client to v2.33.0 (#…
renovate-bot bc921db fix: Document -> types.Document (#227)
andrewferlitsch 639b58c chore(deps): update dependency google-api-python-client to v2.34.0 (#…
renovate-bot 393b605 chore(samples): Add check for tests in directory (#240)
gcf-owl-bot[bot] f1de617 chore(deps): update all dependencies (#238)
renovate-bot c4000fd chore(python): Noxfile recognizes that tests can live in a folder (#246)
gcf-owl-bot[bot] 885cbf3 chore(deps): update all dependencies (#247)
renovate-bot 12d144f chore: use gapic-generator-python 0.62.1 (#260)
gcf-owl-bot[bot] 2a41dc6 chore(deps): update all dependencies (#253)
renovate-bot 036ee3e chore(deps): update all dependencies (#265)
renovate-bot 895b3fc chore(deps): update all dependencies (#269)
renovate-bot bccb3ff chore: Adding support for pytest-xdist and pytest-parallel (#274)
gcf-owl-bot[bot] 53ef0e2 chore(deps): update all dependencies (#278)
renovate-bot fb2ba09 chore(python): use black==22.3.0 (#283)
gcf-owl-bot[bot] 90ca214 chore(deps): update all dependencies (#279)
renovate-bot 01117be chore: use === in requirements.txt for environment specific pins (#284)
renovate-bot 4931fd7 chore(deps): update dependency google-api-python-client to v2.43.0 (#…
renovate-bot 9fdd0e7 chore(deps): update dependency google-auth to v2.6.3 (#296)
renovate-bot cf7329b chore(deps): update dependency google-api-python-client to v2.44.0 (#…
renovate-bot 78fd609 chore(deps): update dependency google-auth to v2.6.4 (#300)
renovate-bot 065dc6d chore(deps): update dependency google-auth to v2.6.5 (#303)
renovate-bot 364b085 chore(deps): update dependency google-api-python-client to v2.45.0 (#…
renovate-bot 1db93cb chore(python): add nox session to sort python imports (#305)
gcf-owl-bot[bot] 6e76642 chore(deps): update dependency google-auth to v2.6.6 (#308)
renovate-bot 3debf00 chore(deps): update dependency pytest to v7.1.2 (#310)
renovate-bot 8cc85a3 chore(deps): update dependency google-api-python-client to v2.46.0 (#…
renovate-bot 61f74ae chore(deps): update dependency google-api-python-client to v2.47.0 (#…
renovate-bot 0a81106 chore(deps): update dependency google-api-python-client to v2.48.0 (#…
renovate-bot 875de18 chore(deps): update dependency google-cloud-language to v2.4.2 (#319)
renovate-bot e1b3fdd chore(deps): update dependency numpy to v1.22.4 (#320)
renovate-bot 1749119 chore(deps): update dependency google-api-python-client to v2.49.0 (#…
renovate-bot e7a3cf7 fix: require python 3.7+ (#336)
gcf-owl-bot[bot] 210ce3c chore(deps): update all dependencies (#329)
renovate-bot fe8d151 chore(deps): update all dependencies (#344)
renovate-bot 40278f4 chore(deps): update all dependencies (#346)
renovate-bot e2acd1d chore(deps): update all dependencies (#347)
renovate-bot da2d2c5 chore(deps): update dependency numpy to v1.23.2 (#352)
renovate-bot 83fdbf6 chore(deps): update all dependencies (#353)
renovate-bot a89da92 chore(deps): update dependency google-auth to v2.11.0 (#354)
renovate-bot 4eda97f chore(deps): update dependency google-api-python-client to v2.58.0 (#…
renovate-bot 0efea8c chore(deps): update dependency pytest to v7.1.3 (#366)
renovate-bot 0de31f6 chore(deps): update dependency google-api-python-client to v2.60.0 (#…
renovate-bot 7cd4d6e chore(deps): update dependency numpy to v1.23.3 (#370)
renovate-bot c0c088a chore: detect samples tests in nested directories (#372)
gcf-owl-bot[bot] 0c5254c chore(deps): update dependency google-api-python-client to v2.61.0 (#…
renovate-bot 57d64d3 chore(deps): update dependency google-auth to v2.11.1 (#374)
renovate-bot 0205f39 chore(deps): update dependency google-api-python-client to v2.62.0 (#…
renovate-bot 523b1f4 docs: update classification sample to use v2 model (#378)
wizeng23 7bf432c chore(deps): update all dependencies (#382)
renovate-bot c883167 chore(deps): update dependency google-cloud-language to v2.6.0 (#383)
renovate-bot ce8bf8e chore(deps): update dependency google-api-python-client to v2.64.0 (#…
renovate-bot 0df3149 chore(deps): update all dependencies (#387)
renovate-bot 422c0f1 chore(deps): update dependency google-api-python-client to v2.65.0 (#…
renovate-bot 3c4810e chore(deps): update dependency pytest to v7.2.0 (#390)
renovate-bot c3b44f4 chore(deps): update dependency google-auth to v2.14.0 (#395)
renovate-bot e3e3819 Merge remote-tracking branch 'migration/main' into python-language-mi…
m-strzelczyk 7a9d480 Removing noxfiles + adding requirements.txt
m-strzelczyk aa1e878 Adding CODEOWNERS and blunderbuss config
m-strzelczyk 9bdb8d8 Fixing license headers
m-strzelczyk c71cbf1 Fixing copywrite header
m-strzelczyk 5df4e95 Adjusting header checker for language samples
m-strzelczyk a2cbc19 Lint fix
m-strzelczyk 21184b7 Merge branch 'main' into python-language-migration
m-strzelczyk 42995b9 Update .github/header-checker-lint.yml
dandhlee 60ab144 Update .github/header-checker-lint.yml
dandhlee 17e1c95 Merge remote-tracking branch 'origin/main' into python-language-migra…
m-strzelczyk 14f760d Adding copyright headers to YAML files
m-strzelczyk 2317c60 Changing CODEOWNER for language
m-strzelczyk c5eb6ba Apply suggestions from code review
dandhlee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md | ||
dandhlee marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/CONTRIBUTING.md | ||
dandhlee marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Google Cloud Natural Language API examples | ||
| | ||
| [![Open in Cloud Shell][shell_img]][shell_link] | ||
| | ||
| [shell_img]: http://gstatic.com/cloudssh/images/open-btn.png | ||
| [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/README.md | ||
| | ||
| This directory contains Python examples that use the | ||
| [Google Cloud Natural Language API](https://cloud.google.com/natural-language/). | ||
| | ||
| - [api](api) has a simple command line tool that shows off the API's features. | ||
| | ||
| - [sentiment](sentiment) contains the [Sentiment Analysis | ||
| Tutorial](https://cloud.google.com/natural-language/docs/sentiment-tutorial) | ||
| code as used within the documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| .. This file is automatically generated. Do not edit this file directly. | ||
| | ||
| Google Cloud Natural Language API Python Samples | ||
| =============================================================================== | ||
| | ||
| .. image:: https://gstatic.com/cloudssh/images/open-btn.png | ||
| :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/api/README.rst | ||
| | ||
| | ||
| This directory contains samples for Google Cloud Natural Language API. The `Google Cloud Natural Language API`_ provides natural language understanding technologies to developers, including sentiment analysis, entity recognition, and syntax analysis. This API is part of the larger Cloud Machine Learning API. | ||
| | ||
| | ||
| | ||
| | ||
| .. _Google Cloud Natural Language API: https://cloud.google.com/natural-language/docs/ | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| Setup | ||
| ------------------------------------------------------------------------------- | ||
| | ||
| | ||
| Authentication | ||
| ++++++++++++++ | ||
| | ||
| This sample requires you to have authentication setup. Refer to the | ||
| `Authentication Getting Started Guide`_ for instructions on setting up | ||
| credentials for applications. | ||
| | ||
| .. _Authentication Getting Started Guide: | ||
| https://cloud.google.com/docs/authentication/getting-started | ||
| | ||
| Install Dependencies | ||
| ++++++++++++++++++++ | ||
| | ||
| #. Clone python-docs-samples and change directory to the sample directory you want to use. | ||
| | ||
| .. code-block:: bash | ||
| | ||
| $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git | ||
| | ||
| #. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. | ||
| | ||
| .. _Python Development Environment Setup Guide: | ||
| https://cloud.google.com/python/setup | ||
| | ||
| #. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. | ||
| | ||
| .. code-block:: bash | ||
| | ||
| $ virtualenv env | ||
| $ source env/bin/activate | ||
| | ||
| #. Install the dependencies needed to run the samples. | ||
| | ||
| .. code-block:: bash | ||
| | ||
| $ pip install -r requirements.txt | ||
| | ||
| .. _pip: https://pip.pypa.io/ | ||
| .. _virtualenv: https://virtualenv.pypa.io/ | ||
| | ||
| Samples | ||
| ------------------------------------------------------------------------------- | ||
| | ||
| Analyze syntax | ||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
| | ||
| .. image:: https://gstatic.com/cloudssh/images/open-btn.png | ||
| :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/api/analyze.py,language/api/README.rst | ||
| | ||
| | ||
| | ||
| | ||
| To run this sample: | ||
| | ||
| .. code-block:: bash | ||
| | ||
| $ python analyze.py | ||
| | ||
| usage: analyze.py [-h] {entities,sentiment,syntax} text | ||
| | ||
| Analyzes text using the Google Cloud Natural Language API. | ||
| | ||
| positional arguments: | ||
| {entities,sentiment,syntax} | ||
| text | ||
| | ||
| optional arguments: | ||
| -h, --help show this help message and exit | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| .. _Google Cloud SDK: https://cloud.google.com/sdk/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # This file is used to generate README.rst | ||
| | ||
| product: | ||
| name: Google Cloud Natural Language API | ||
| short_name: Cloud Natural Language API | ||
| url: https://cloud.google.com/natural-language/docs/ | ||
| description: > | ||
| The `Google Cloud Natural Language API`_ provides natural language | ||
| understanding technologies to developers, including sentiment analysis, | ||
| entity recognition, and syntax analysis. This API is part of the larger | ||
| Cloud Machine Learning API. | ||
| | ||
| setup: | ||
| - auth | ||
| - install_deps | ||
| | ||
| samples: | ||
| - name: Analyze syntax | ||
| file: analyze.py | ||
| show_help: true | ||
| | ||
| folder: language/api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| #!/usr/bin/env python | ||
| | ||
| # Copyright 2016 Google, Inc | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| | ||
| """Analyzes text using the Google Cloud Natural Language API.""" | ||
| | ||
| import argparse | ||
| import json | ||
| import sys | ||
| | ||
| import googleapiclient.discovery | ||
| | ||
| | ||
| def get_native_encoding_type(): | ||
| """Returns the encoding type that matches Python's native strings.""" | ||
| if sys.maxunicode == 65535: | ||
| return "UTF16" | ||
| else: | ||
| return "UTF32" | ||
| | ||
| | ||
| def analyze_entities(text, encoding="UTF32"): | ||
| body = { | ||
| "document": {"type": "PLAIN_TEXT", "content": text}, | ||
| "encoding_type": encoding, | ||
| } | ||
| | ||
| service = googleapiclient.discovery.build("language", "v1") | ||
| | ||
| request = service.documents().analyzeEntities(body=body) | ||
| response = request.execute() | ||
| | ||
| return response | ||
| | ||
| | ||
| def analyze_sentiment(text, encoding="UTF32"): | ||
| body = { | ||
| "document": {"type": "PLAIN_TEXT", "content": text}, | ||
| "encoding_type": encoding, | ||
| } | ||
| | ||
| service = googleapiclient.discovery.build("language", "v1") | ||
| | ||
| request = service.documents().analyzeSentiment(body=body) | ||
| response = request.execute() | ||
| | ||
| return response | ||
| | ||
| | ||
| def analyze_syntax(text, encoding="UTF32"): | ||
| body = { | ||
| "document": {"type": "PLAIN_TEXT", "content": text}, | ||
| "encoding_type": encoding, | ||
| } | ||
| | ||
| service = googleapiclient.discovery.build("language", "v1") | ||
| | ||
| request = service.documents().analyzeSyntax(body=body) | ||
| response = request.execute() | ||
| | ||
| return response | ||
| | ||
| | ||
| if __name__ == "__main__": | ||
| parser = argparse.ArgumentParser( | ||
| description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter | ||
| ) | ||
| parser.add_argument("command", choices=["entities", "sentiment", "syntax"]) | ||
| parser.add_argument("text") | ||
| | ||
| args = parser.parse_args() | ||
| | ||
| if args.command == "entities": | ||
| result = analyze_entities(args.text, get_native_encoding_type()) | ||
| elif args.command == "sentiment": | ||
| result = analyze_sentiment(args.text, get_native_encoding_type()) | ||
| elif args.command == "syntax": | ||
| result = analyze_syntax(args.text, get_native_encoding_type()) | ||
| | ||
| print(json.dumps(result, indent=2)) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.