Comments (10)
Could you report the error message?
from googlelanguager.
Thanks for the quick work. Can I already github-install the new version?
Out of curiosity, w/ nlp_type="analyzeSyntax" I would only expect POS and lemmatization, and not expect sentiment to be returned, so it would seem the API is doing the right thing.
So my newbie question is: Is a fixed return format from a REST API a requirement in general? What am I missing?
from googlelanguager.
2018-02-16 17:21:50 -- analyzeSyntax: 23 characters
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 1, 0
Error: Result 1 is not a length 1 atomic vector
In addition: Warning message:
In call_api(the_body = body) :
API Data failed to parse. Returning parsed from JSON content.
Use this to test against your data_parse_function.
from googlelanguager.
Mark any luck with this issue?
from googlelanguager.
The problem was the API returned is inconsistent - when you request everything it includes the sentiment score, when you request just the analyzeSyntax
part it omits it. This is a bug at the APIs end, which I will report, but I fixed the R error so that it won't stop if there isn't any content - it will return what it gets but it may not be what you needed in the first place :)
from googlelanguager.
Yes load the Github via remotes::install_github("ropensci/googleLanguageR")
They recently updated the API to include sentiment per entity, not just per document, which is what is (or isn't) being returned, so if you don't need it thats cool.
from googlelanguager.
I would argue that processing complexity is ordered as
nlp_type = c("analyzeSyntax", "analyzeSentiment", "analyzeEntities", "analyzeEntitySentiment", "annotateText")
i.e., if one explicitly requests syntax analysis ONLY he/she should not expect sentiment nor entities nor entity sentiment.
so maybe the API is doing the right thing already?
from googlelanguager.
I thought they were more independent than that but that does make sense.
from googlelanguager.
the reason NLP doesn't work in the real world (other than for fixed utterances) is because they proceed in this ordered fashion, which is also the reason most computer vision pipelines don't work well (edge detection, feature detection, object detection, etc.), from low to high level. indeed, true intelligence relies on a stack of modules with back-and-forth communication, where all are engaged simultaneously, perhaps seeking consistency maximization, impossible in the serial model.
crucially, that's why sentiment analysis fails to decode sarcasm. "congrats to XYZ customer service. after a quick 34 days in line, a brilliant representative happily deleted my purchase record".
from googlelanguager.
Interesting, I wonder if its easier to get these individual elements (e.g. per sentence sentiment) what people will build on top. For instance, your example relies on the context that 34 days in line isn't "quick", if that context can be added perhaps it can reverse the sentiment score and give it more a chance to detect humans being human :)
I missed your question:
So my newbie question is: Is a fixed return format from a REST API a requirement in general? What am I missing?
I read annotateText
as a convenience function that is the combination of all the analysis in one big list, e.g analyzeSyntax
plus the other 3 options. Its a bug in my mind if the analyzeSyntax
part of the annotateText
return is not the same as when you request analyzeSyntax
on its own.
from googlelanguager.
Related Issues (20)
- Error with speaker diarization HOT 7
- I am getting this error on passing a wav file into readwave function. HOT 1
- Support SSML for text-to-speech HOT 2
- Support device profiles in text to speech
- Authenticated website examples
- Step #1: API returned: Invalid JSON payload received. Unknown name "enableSpeakerDiarization" at 'config': Cannot find field. HOT 1
- Package has a VignetteBuilder field but no prebuilt vignette index.
- Possible issue with asynch call? HOT 2
- gl_speech request almost always times out, no proper error message HOT 18
- no access to Google Cloud Service HOT 2
- Entity sentiment shows but document sentiment shows NA HOT 4
- googleLanguageR does not translate tweets. HOT 8
- lack of MP3 encoding HOT 1
- Error midway and no translated text output HOT 3
- Call for co-maintainers :-) HOT 3
- Split calls in gl_translate more effectively - not all or nothing? HOT 2
- Error: lexical error: invalid char in json text. HOT 1
- Link to package webpage broken - gives 404 on markedmonson.me ...
- Add support to translate files HOT 7
- gl_talk: language code detection HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googlelanguager.