google-natural-language

Too many open files: '/home/USER/PATH/SERVICE_ACCOUNT.json' when calling Google's Natural Language API

无人久伴 提交于 2021-02-11 06:27:39
问题 I'm working on a Sentiment Analysis project using the Google Cloud Natural Language API and Python, this question might be similar to this other question, what I'm doing is the following: Reads a CSV file from Google Cloud Storage, file has approximately 7000 records. Converts the CSV into a Pandas DataFrame. Iterates over the dataframe and calls the Natural Language API to perform sentiment analysis on one of the dataframe's columns, on the same for loop I extract the score and magnitude

dataset import error for AutoML text classification

浪子不回头ぞ 提交于 2021-02-08 10:13:53
问题 I have trying to import dataset into AutoML NL Text Classification. However, the Ui gave me an error of Invalid row in CSV file , Error details: Error detected: "FILE_TYPE_NOT_SUPPORTED" I am uploading the csv file, what should I do? 回答1: Please make sure there is no hidden quotes in your dataset. Complete requirements can be found on “Preparing your training data” page. Common .csv errors: Using Unicode characters in labels. For example, Japanese characters are not supported. Using spaces

Google Natural Language API - ERROR: Too many open files

醉酒当歌 提交于 2020-05-17 09:30:07
问题 I am using the Google Natural Language Content Classification API. I am authenticating through a service account .json file in a directory with the path exposed in the GOOGLE_APPLICATION_CREDENTIALS environment variable. There is no issue when I am running my classification script as 1 instance. However, when I run my classification script in parallel (4,6,8,10 Docker containers running in 1 machine), I will get the below error occasionally: [Errno 24] Too many open files: '/PATH/TO/MY-JSON

ImportError: cannot import name language in Google Cloud Language API

梦想的初衷 提交于 2020-01-04 13:46:08
问题 I am trying to use this sample code from the Google Natural Language API to get a sentiment score back. However, each time I run the code, I get an "ImportError: cannot import name language." error on the first line. I have pip installed the library, tried uninstalling and reinstalling, made the credentials on the console (the API is shown to be enabled) and looked at this tutorial too and completed those steps in the answer: Google sentiment analysis - ImportError: cannot import name

Python Google Cloud Natural Language API returns Bad Gateway error with status 502

我只是一个虾纸丫 提交于 2019-12-25 00:36:52
问题 I'm working on a project using Python(3.6) and Django(2) in which I need to process all text files from a directory using Google's Natural Language API python's Client. At the moment, there are 30 text files in my folder for testing purpose, the programs perform sentiment_analysis on 28 files but when reached 29th file it returns an error like below: raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: https://language.googleapis.com/v1beta2/documents

Google cloud Natural Language API error:google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials

梦想的初衷 提交于 2019-12-11 16:34:46
问题 I use Google cloud's Natural Language API from this link: And I use this command in powershell : $env:GOOGLE_APPLICATION_CREDENTIALS="D:\analyze_sentiment\MyFirstProject-bbe4f7bccb98.json" Then I use this command in cmd: set GOOGLE_APPLICATION_CREDENTIALS=D:\analyze_sentiment\MyFirstProject-bbe4f7bccb98.json But when I use python code: from google.cloud import language from google.cloud.language import enums from google.cloud.language import types # Instantiates a client client = language

Java Google AutoML NLP client waiting forever for response (no exception thrown)

风流意气都作罢 提交于 2019-12-11 06:05:20
问题 I trained succesfully my own NLP AutoML model yesterday. I am able to do quite accurate predictions in GCP console. Everything ran smoothly. Today I have been trying to do prediction from Java client based on this example https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/language/automl/src/main/java/com/google/cloud/language/samples/PredictionApi.java I use correct projectId and modelId that I copied from GCP console but I am waiting for result forever. Even after couple