-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlexexpander_howto1.py
54 lines (27 loc) · 958 Bytes
/
lexexpander_howto1.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python
# coding: utf-8
# In[1]:
#import:
import LexExpander
# In[2]:
#create an LexExpander Instance ...
# we also need an embedding file
# and optionally a steering|starting point: these are some candidates
# that we initially give as a steering (where to search)
EMBEDDINGFILE = "smd_50k_kv"
LEXICON = "Tiere_minimal.txt"
STARTINGPOINT = ["Elefant", "Nashorn"]
my_expander = LexExpander.LexExpander( given_embedding_file= EMBEDDINGFILE ,
lexicon_file = LEXICON,
candidates_list = STARTINGPOINT,
# target_folder = ".",
)
# In[3]:
#prepare: this means: load lexicons, embeddings, set stuff ...
my_expander.prepare(verbose=True)
# In[4]:
#and launch:
my_expander.run()
# In[6]:
my_expander.write_out(target_filename="tiere_not_so_minimal.txt")
# In[ ]: