Created
August 23, 2017 17:36
-
-
Save bambooforest/778a890b5dc6e14284fd490fbdbdf262 to your computer and use it in GitHub Desktop.
skip or not skip words in acqdiv pipeline
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
w_ids = [] | |
for w in words: | |
if w: | |
w.update(corpus=self.corpus, language=self.language) | |
w_id, = insert_word(session_id_fk=s_id, utterance_id_fk=u_id, **w).inserted_primary_key | |
else: | |
w_id = None | |
w_ids.append(w_id) | |
link_to_word = len(morphemes) == len(words) and None not in w_ids | |
## | |
w_ids = [] | |
for w in words: | |
if w: | |
w.update(corpus=self.corpus, language=self.language) | |
w_id, = insert_word(session_id_fk=s_id, utterance_id_fk=u_id, **w).inserted_primary_key | |
w_ids.append(w_id) | |
link_to_word = len(morphemes) == len(w_ids) | |
## | |
w_ids = [insert_word(session_id_fk=s_id, utterance_id_fk=u_id, **w).inserted_primary_key[0] | |
for w in w if w] | |
link_to_word = len(morphemes) == len(w_ids) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment