0110937ab04f4298f98963bed1de08962d776b24,src/fonduer/utils/data_model_utils/structural.py,,common_ancestor,#Any#,172
Before Change
span1 = _to_span(c[0])
span2 = _to_span(c[1])
ancestor1 = np.array(span1.sentence.xpath.split("/"))
ancestor2 = np.array(span2.sentence.xpath.split("/"))
min_len = min(ancestor1.size, ancestor2.size)
return list(ancestor1[: np.argmin(ancestor1[:min_len] == ancestor2[:min_len])])
After Change
:param c: The multinary-Mention Candidate to evaluate
spans = [_to_span(i) for i in c]
ancestors = [np.array(span.sentence.xpath.split("/")) for span in spans]
min_len = min([a.size for a in ancestors])
arrays = np.array([a[:min_len] for a in ancestors] )
arg_min = np.argmin(arrays[:-1] == arrays[1:], axis=1)
val = np.min(arg_min[np.nonzero(arg_min)])
return list(ancestors [0 ][:val])
def lowest_common_ancestor_depth(c: Tuple[SpanMention, ...]) -> int:
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 7
Instances Project Name: HazyResearch/fonduer
Commit Name: 0110937ab04f4298f98963bed1de08962d776b24
Time: 2020-07-01
Author: wajdikhattel@think-it.io
File Name: src/fonduer/utils/data_model_utils/structural.py
Class Name:
Method Name: common_ancestor
Project Name: mne-tools/mne-python
Commit Name: fa91217b895957c4106d6175e27d72a48f4f05dc
Time: 2019-01-12
Author: jnu@iki.fi
File Name: mne/viz/topo.py
Class Name:
Method Name: _plot_evoked_topo
Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 974ad2bb7521c96e0efb38b06a62baa48c8e9e0a
Time: 2017-10-31
Author: max.lapan@gmail.com
File Name: ch07/01_dqn_basic.py
Class Name:
Method Name: unpack_batch
Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: e5b1ea4b6444f79cda3c88d1469a2f7af0c5f36c
Time: 2017-10-31
Author: max.lapan@gmail.com
File Name: ch07/03_dqn_double.py
Class Name:
Method Name: unpack_batch
Project Name: WZBSocialScienceCenter/tmtoolkit
Commit Name: eb13c2ea02e0e06c06b288e3590ce04cc014ba04
Time: 2019-03-22
Author: markus.konrad@wzb.eu
File Name: tmtoolkit/topicmod/tm_gensim.py
Class Name: MultiprocEvaluationWorkerGensim
Method Name: fit_model