-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
35 lines (29 loc) · 785 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "glove.h"
int
main (int argc, char **argv)
{
glove *instance = glove_create ("../embeddings.txt", 1, 50);
float *embedding = glove_get_embedding (instance, "they");
for (int i = 0; i < 50; i++)
{
printf ("%f ", embedding[i]);
}
printf ("\n");
while (1)
{
float score;
char word1[80];
char word2[80];
scanf ("%s %s", word1, word2);
if (glove_compare_cosine (instance, word1, word2, &score))
{
printf ("Score: %f \n", score);
}
else
{
printf ("Embeddings not found for word(s)\n");
}
}
glove_release (instance);
return 0;
}