关于“使用 Natural Language API 对文本进行分类”的评价

73300 条评价

Oleh T. · 已于 over 2 years前审核

very nice.

Arcanjo G. · 已于 over 2 years前审核

I think, you know, that the second part, related to classify-text.py does not work need to install pip install google.cloud for python pip install --user google-cloud-bigquery==2.34.4 "shapely<2" google-cloud-storage google-cloud-language fix errors in classify-text.py insert Project ID but thanks anyway for the interesting challenge

BuYn M. · 已于 over 2 years前审核

Kritika G. · 已于 over 2 years前审核

Camilo R. · 已于 over 2 years前审核

Deepnita M. · 已于 over 2 years前审核

Bad formatted bigquery python script with some errors not working Script must be like: ``` # Import necessary libraries from google.cloud import storage, language, bigquery # Set up your GCS, NL, and BigQuery clients storage_client = storage.Client() nl_client = language.LanguageServiceClient() bq_client = bigquery.Client(project='qwiklabs-gcp-01-b8b997bbdb2b') # Define dataset and table dataset_ref = bq_client.dataset('news_classification_dataset') dataset = bigquery.Dataset(dataset_ref) table_ref = dataset.table('article_data') table = bq_client.get_table(table_ref) # Function to classify the text def classify_text(article): response = nl_client.classify_text( document=language.Document( content=article, type_=language.Document.Type.PLAIN_TEXT ) ) return response rows_for_bq = [] files = storage_client.bucket('qwiklabs-test-bucket-gsp063').list_blobs() print("Got article files from GCS, sending them to the NL API (this will take ~2 minutes)...") # Send files to the NL API and save the result to send to BigQuery for file in files: if file.name.endswith('txt'): article_text = file.download_as_bytes() nl_response = classify_text(article_text) if len(nl_response.categories) > 0: rows_for_bq.append((str(article_text), nl_response.categories[0].name, nl_response.categories[0].confidence)) print("Writing NL API article data to BigQuery...") # Write article text + category data to BQ errors = bq_client.insert_rows(table, rows_for_bq) assert errors == [] ```

OLEG M. · 已于 over 2 years前审核

семен И. · 已于 over 2 years前审核

Nickolay K. · 已于 over 2 years前审核

Denys V. · 已于 over 2 years前审核

Volodymyr P. · 已于 over 2 years前审核

Дмитро М. · 已于 over 2 years前审核

Vinicius G. · 已于 over 2 years前审核

Данило Ч. · 已于 over 2 years前审核

Satrajit S. · 已于 over 2 years前审核

In task 6. The Python code is copied with a syntax error. Namely, the declaration of variables is not on a new line

Oleksandr K. · 已于 over 2 years前审核

Ihor K. · 已于 over 2 years前审核

Yuriy K. · 已于 over 2 years前审核

muito bom

Paulo K999 G. · 已于 over 2 years前审核

D P. · 已于 over 2 years前审核

Pooja R. · 已于 over 2 years前审核

Sheeraz C. · 已于 over 2 years前审核

I was not able to finish it. When I run Pyton script I'he got an error "SyntaxError: invalid syntax" at line 5

Елена Л. · 已于 over 2 years前审核

Mykhailo T. · 已于 over 2 years前审核

Serhii K. · 已于 over 2 years前审核

我们无法确保发布的评价来自已购买或已使用产品的消费者。评价未经 Google 核实。