Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Commit

Permalink
Remove the commented code and provide a description in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dustalov committed Nov 14, 2016
1 parent 09190af commit 2dc9200
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
18 changes: 0 additions & 18 deletions 10-disambiguate.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def emit(word):
candidates = [(nsid, sim(vector, v.transform(neighbours[nsid]))[0, 0]) for nsid in neighbours]
nsid, cosine = max(candidates, key=itemgetter(1))
if cosine > 0:
# if cosine > 0 or len(candidates) == 1:
nsense = '%s#%d' % (neighbour, nsid)
sneighbours[sense][nsense] = weight

Expand All @@ -56,20 +55,3 @@ def emit(word):
for sense, neighbours in sneighbours.items():
for nsense, weight in neighbours.items():
print('%s\t%s\t%f' % (sense, nsense, weight))

# for word, senses in wsi.items():
# for sid, words in senses.items():
# sense = '%s#%d' % (word, sid)
# vector = v.transform(words)
# sneighbours = {}

# for neighbour, weight in words.items():
# neighbours = wsi[neighbour]
# items = [(nsid, sim(vector, v.transform(neighbours[nsid]))[0, 0]) for nsid in neighbours]
# nsid, cosine = max(items, key=itemgetter(1))
# if cosine > 0:
# nsense = '%s#%d' % (neighbour, nsid)
# sneighbours[nsense] = weight

# for nsense, weight in sneighbours.items():
# print('%s\t%s\t%f' % (sense, nsense, weight))
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# concept-discovery
Concept Discovery from Synonymy Graphs
# Concept Discovery from Synonymy Graphs

This is an implementation of concept discovery (or synset induction, if you wish) approach that uses synonymy graphs. It is based on three algorithms:

* ego-network clustering for inducing the word senses ([Panchenko et al., 2016](https://www.linguistics.rub.de/konvens16/pub/24_konvensproc.pdf)),
* cosine-based sense disambiguation for disambiguating them ([Faralli et al., 2016](http://link.springer.com/chapter/10.1007/978-3-319-46547-0_7)),
* Chinese Whispers for graph clustering ([Biemann, 2006](http://dl.acm.org/citation.cfm?id=1654774)).

However, it is not based on distributional methods.

0 comments on commit 2dc9200

Please sign in to comment.