Skip to content

Commit

Permalink
Fixed failed tests on Kokoro (Natural Language API) [(#1185)](GoogleC…
Browse files Browse the repository at this point in the history
…loudPlatform/python-docs-samples#1185)

* Add Snippet for Listing All Subscriptions in a Project

* Fixed the failed tests on Kokoro

classify_text_tutorial_test.py::test_query_text
classify_text_tutorial_test.py::test_query_category
  • Loading branch information
michaelawyu authored and busunkim96 committed Sep 29, 2020
1 parent 20e53c4 commit e37000c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ def similarity(categories1, categories2):
categories1 = split_labels(categories1)
categories2 = split_labels(categories2)

norm1 = numpy.linalg.norm(categories1.values())
norm2 = numpy.linalg.norm(categories2.values())
norm1 = numpy.linalg.norm(list(categories1.values()))
norm2 = numpy.linalg.norm(list(categories2.values()))

# Return the smallest possible similarity if either categories is empty.
if norm1 == 0 or norm2 == 0:
Expand Down

0 comments on commit e37000c

Please sign in to comment.