Classify Text into Categories with the Natural Language API avis
Chargement...
Aucun résultat.

Mettez en pratique vos compétences dans la console Google Cloud

Classify Text into Categories with the Natural Language API avis

66484 avis

Kritika G. · Examiné il y a plus d'un an

Camilo P. · Examiné il y a plus d'un an

Deepnita M. · Examiné il y a plus d'un an

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. · Examiné il y a plus d'un an

семен И. · Examiné il y a plus d'un an

Nickolay K. · Examiné il y a plus d'un an

Denys V. · Examiné il y a plus d'un an

Volodymyr P. · Examiné il y a plus d'un an

Дмитро М. · Examiné il y a plus d'un an

Vinicius G. · Examiné il y a plus d'un an

Данило Ч. · Examiné il y a plus d'un an

Satrajit S. · Examiné il y a plus d'un an

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. · Examiné il y a plus d'un an

Ihor K. · Examiné il y a plus d'un an

Yuriy K. · Examiné il y a plus d'un an

muito bom

Paulo K999 G. · Examiné il y a plus d'un an

D P. · Examiné il y a plus d'un an

Pooja R. · Examiné il y a plus d'un an

Sheeraz C. · Examiné il y a plus d'un an

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

Елена Л. · Examiné il y a plus d'un an

Mykhailo T. · Examiné il y a plus d'un an

Serhii K. · Examiné il y a plus d'un an

Mykola V. · Examiné il y a plus d'un an

Volodymyr M. · Examiné il y a plus d'un an

Pratik N. · Examiné il y a plus d'un an

Nous ne pouvons pas certifier que les avis publiés proviennent de consommateurs qui ont acheté ou utilisé les produits. Les avis ne sont pas vérifiés par Google.