e97af48c033d53b18ce578b0448bc1f565717ceb,snips_nlu/dataset/intent.py,Intent,from_file,#Any#Any#,66

Before Change


        intent_name = stem[7:]
        if not intent_name:
            raise IntentFormatError("Intent name must not be empty")
        dataset = cls(intent_name)
        with filepath.open(encoding="utf-8") as f:
            lines = iter(l.strip() for l in f if l.strip())
            dataset.add_utterances(lines)
            return dataset

    def add_utterances(self, samples_iter):
        for sample in samples_iter:
            utterance = IntentUtterance.parse(sample)

After Change


            raise IntentFormatError("Intent name must not be empty")
        with filepath.open(encoding="utf-8") as f:
            lines = iter(l.strip() for l in f if l.strip())
            utterances = [IntentUtterance.parse(sample) for sample in lines]
        return cls(intent_name, utterances)

    def _complete_slot_name_mapping(self):
        for utterance in self.utterances:
            for chunk in utterance.slot_chunks:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: snipsco/snips-nlu
Commit Name: e97af48c033d53b18ce578b0448bc1f565717ceb
Time: 2018-11-22
Author: adrien.ball@snips.ai
File Name: snips_nlu/dataset/intent.py
Class Name: Intent
Method Name: from_file


Project Name: snipsco/snips-nlu
Commit Name: bdb3bd5bd812fdc9860d876d48489c89675491aa
Time: 2017-03-24
Author: adrien.ball@snips.net
File Name: snips_nlu/nlu_engine/nlu_engine.py
Class Name: SnipsNLUEngine
Method Name: parse


Project Name: pantsbuild/pants
Commit Name: 8c4f6bc48da780fe9be5748cccc4c10e39562dce
Time: 2015-04-28
Author: benjyw@gmail.com
File Name: src/python/pants/backend/jvm/tasks/jvm_compile/scala/zinc_analysis_parser.py
Class Name: ZincAnalysisParser
Method Name: parse


Project Name: pantsbuild/pants
Commit Name: 6fd4dbbc75bfe298070a7176e39859eb527dd04e
Time: 2020-08-04
Author: stuhood@gmail.com
File Name: src/python/pants/build_graph/address.py
Class Name: Address
Method Name: parse


Project Name: SheffieldML/GPy
Commit Name: ddcaf8f8b52f258492938a3e5cde07f6a181ad4d
Time: 2014-07-29
Author: alan.daniel.saul@gmail.com
File Name: setup.py
Class Name:
Method Name: read