Spaces:
Sleeping
Sleeping
felipekitamura
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -87,12 +87,12 @@ def inference(word1, word2, word3):
|
|
87 |
word_list.extend(output)
|
88 |
words = {key: model[key] for key in word_list}
|
89 |
words[word3 + " + (" + word2 + " - " + word1 + ")"] = transform
|
90 |
-
|
91 |
#print(data.shape)
|
92 |
labels = words.keys()
|
93 |
#reduced_data_pca = reduce_dimensions(data, method='PCA')
|
94 |
#print(reduced_data_pca.shape)
|
95 |
-
plot_reduced_data(
|
96 |
return cache
|
97 |
|
98 |
examples = [
|
|
|
87 |
word_list.extend(output)
|
88 |
words = {key: model[key] for key in word_list}
|
89 |
words[word3 + " + (" + word2 + " - " + word1 + ")"] = transform
|
90 |
+
data2 = np.concatenate([x[np.newaxis, :] for x in words.values()], axis=0)
|
91 |
#print(data.shape)
|
92 |
labels = words.keys()
|
93 |
#reduced_data_pca = reduce_dimensions(data, method='PCA')
|
94 |
#print(reduced_data_pca.shape)
|
95 |
+
plot_reduced_data(data2, labels, 'PCA Results')
|
96 |
return cache
|
97 |
|
98 |
examples = [
|