c59f0d1b133fb0523c1137fe134586fe822f2720,neuralcoref/document.py,Document,add_utterances,#Document#Any#Any#Any#,551
Before Change
utterances_index = []
utt_start = len(self.utterances)
for utt_index, (utterance, speaker_id) in enumerate(zip_longest(utterances, utterances_speaker)):
if utterance is None:
break
// Pipe currently broken in spacy 2 alpha
// Also, spacy 2 currently throws an exception on empty strings
try:
doc = self.nlp(utterance)
except IndexError:
doc = self.nlp(u" ")
if self.debug: print("Empty string")
if speaker_id not in self.speakers:
speaker_name = speakers_names.get(speaker_id, None) if speakers_names else None
self.speakers[speaker_id] = Speaker(speaker_id, speaker_name)
After Change
utterances_speaker = ((i + a + 1) % 2 for i in range(len(utterances)))
utterances_index = []
utt_start = len(self.utterances)
docs = list(self.nlp.pipe(utterances) )
m_spans = list(extract_mentions_spans(doc, use_no_coref_list=self.use_no_coref_list) for doc in docs)
for utt_index, (doc, m_spans, speaker_id) in enumerate(zip_longest(docs, m_spans, utterances_speaker)):
if speaker_id not in self.speakers:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: huggingface/neuralcoref
Commit Name: c59f0d1b133fb0523c1137fe134586fe822f2720
Time: 2018-04-05
Author: thomwolf@gmail.com
File Name: neuralcoref/document.py
Class Name: Document
Method Name: add_utterances
Project Name: explosion/spaCy
Commit Name: 52c180ecf5474e62f305424065d645d14fc43b7b
Time: 2017-08-14
Author: honnibal+gh@gmail.com
File Name: spacy/language.py
Class Name: Language
Method Name: evaluate
Project Name: huggingface/neuralcoref
Commit Name: 205e4e688ca56b7569011b94c630eab975ce4ef5
Time: 2018-02-15
Author: thomwolf@gmail.com
File Name: neuralcoref/data.py
Class Name: Data
Method Name: add_utterances