update comments
Browse files- generate-distances.py +6 -7
generate-distances.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
#!/usr/bin/python3
|
2 |
|
3 |
-
"""
|
4 |
Plan:
|
5 |
Read in fullword.json for list of words and token
|
6 |
Read in pre-calculated "proper" embedding for each token from safetensor file
|
7 |
-
|
8 |
-
|
|
|
9 |
"""
|
10 |
|
11 |
|
@@ -97,8 +98,6 @@ def find_closest(targetword):
|
|
97 |
print_distances(targetemb)
|
98 |
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
for line in sys.stdin:
|
103 |
-
input_text = line.rstrip()
|
104 |
find_closest(input_text)
|
|
|
1 |
#!/usr/bin/python3
|
2 |
|
3 |
+
"""
|
4 |
Plan:
|
5 |
Read in fullword.json for list of words and token
|
6 |
Read in pre-calculated "proper" embedding for each token from safetensor file
|
7 |
+
Prompt user for a word from the list
|
8 |
+
Generate a tensor array of distance to all the other known words
|
9 |
+
Print out the 20 closest ones
|
10 |
"""
|
11 |
|
12 |
|
|
|
98 |
print_distances(targetemb)
|
99 |
|
100 |
|
101 |
+
while True:
|
102 |
+
input_text=input("Input a word now:")
|
|
|
|
|
103 |
find_closest(input_text)
|