You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran the bot in Python 2.7 and got this error:
Traceback (most recent call last):
File "bot.py", line 118, in
main()
File "bot.py", line 100, in main
print get_response(msg)
File "bot.py", line 84, in get_response
val = sim(msg, question)
File "bot.py", line 75, in sim
return alpha*sem_sim(s1, s2) + (1-alpha)*cos_sim(s1, s2)
File "bot.py", line 72, in cos_sim
return cosine_similarity([d[0][p] for p in all_tags], [d[1][p] for p in all_tags])[0][0]
File "C:\Users\AppData\Local\Continuum\anaconda3\envs\Test\lib\site-packages\sklearn\metrics\pairwise.py", line 896, in cosine_similarity
X, Y = check_pairwise_arrays(X, Y)
File "C:\Users\AppData\Local\Continuum\anaconda3\envs\Test\lib\site-packages\sklearn\metrics\pairwise.py", line 111, in check_pairwise_arrays
warn_on_dtype=warn_on_dtype, estimator=estimator)
File "C:\Users\AppData\Local\Continuum\anaconda3\envs\Test\lib\site-packages\sklearn\utils\validation.py", line 552, in check_array
"if it contains a single sample.".format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 1. 0. 1. 0. 0. 1. 0. 0.].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
The text was updated successfully, but these errors were encountered:
I ran the bot in Python 2.7 and got this error:
Traceback (most recent call last):
File "bot.py", line 118, in
main()
File "bot.py", line 100, in main
print get_response(msg)
File "bot.py", line 84, in get_response
val = sim(msg, question)
File "bot.py", line 75, in sim
return alpha*sem_sim(s1, s2) + (1-alpha)*cos_sim(s1, s2)
File "bot.py", line 72, in cos_sim
return cosine_similarity([d[0][p] for p in all_tags], [d[1][p] for p in all_tags])[0][0]
File "C:\Users\AppData\Local\Continuum\anaconda3\envs\Test\lib\site-packages\sklearn\metrics\pairwise.py", line 896, in cosine_similarity
X, Y = check_pairwise_arrays(X, Y)
File "C:\Users\AppData\Local\Continuum\anaconda3\envs\Test\lib\site-packages\sklearn\metrics\pairwise.py", line 111, in check_pairwise_arrays
warn_on_dtype=warn_on_dtype, estimator=estimator)
File "C:\Users\AppData\Local\Continuum\anaconda3\envs\Test\lib\site-packages\sklearn\utils\validation.py", line 552, in check_array
"if it contains a single sample.".format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 1. 0. 1. 0. 0. 1. 0. 0.].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
The text was updated successfully, but these errors were encountered: