-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Chinmay26/qgram_indexer
add Qgram indexer
- Loading branch information
Showing
14 changed files
with
192,494 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import sys, os | ||
sys.path.append(os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), | ||
"../../rltk"))) | ||
import rltk | ||
tk = rltk.init() | ||
|
||
print("Running Qgram indexing on GM museum dataset") | ||
fi1 = tk.get_file_iterator('../datasets/ima.json', type='json_line', id_path='uri[*].value') | ||
tk.q_gram_blocking(file_iter=fi1, q=[3], value_path=['name[*].value'], output_file_path='./ima_qgrams.json' ) | ||
|
||
|
||
print("Running Qgram indexing on ULAN and GM museum datasets") | ||
fu1 = tk.get_file_iterator('../datasets/ulan.json', type='json_line', id_path='uri[*].value') | ||
fi2 = tk.get_file_iterator('../datasets/ima.json', type='json_line', id_path='uri[*].value') | ||
|
||
tk.q_gram_blocking(file_iter1=fu1, q1=[3], value_path1=['name[*].value'], file_iter2=fi2, | ||
q2=[3], value_path2=['name[*].value'], output_file_path='./qgram_ulan_gm.json' ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from qgram import qgram_indexing |
Oops, something went wrong.