Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Absinth - A Small World of Semantic Similarity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Victor Zimmermann
Absinth - A Small World of Semantic Similarity
Commits
6232f19b
Commit
6232f19b
authored
7 years ago
by
Victor Zimmermann
Browse files
Options
Downloads
Patches
Plain Diff
Add target word from input line for testing purposes
parent
dd95c9dc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/absinth.py
+2
-1
2 additions, 1 deletion
code/absinth.py
with
2 additions
and
1 deletion
code/absinth.py
+
2
−
1
View file @
6232f19b
import
os
# for reading files
import
sys
#from tqdm import tqdm # for counting seconds
import
spacy
# for nlp
import
networkx
as
nx
# for visualisation
...
...
@@ -186,7 +187,7 @@ if __name__ == '__main__':
corpus_path
=
'
/proj/absinth/wikipedia.txt.dump.20140615-en.SZTAKI
'
G
=
Graph
()
#initialises graph
G
.
build
(
corpus_path
,
'
division_by_zero
'
,
filters
)
#builds graph from corpus with target and filters
G
.
build
(
corpus_path
,
sys
.
argv
[
1
]
,
filters
)
#builds graph from corpus with target and filters
for
hub
in
G
.
root_hubs
():
print
(
hub
.
key
,
'
-->
'
,
list
(
hub
.
neighbors
.
keys
()),
'
\n
'
)
#prints senses
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment