791aee867bb9fdc51756074e2f2117c11c843fde,rasa/shared/nlu/training_data/formats/readerwriter.py,TrainingDataWriter,generate_message,#Any#,75

Before Change


        // format (e.g. `/greet{"name": "Rasa"}) and we don"t have to add the NLU
        // entity annotation
        if not text.startswith(INTENT_MESSAGE_PREFIX):
            entities = sorted(message.get("entities", []), key=lambda k: k["start"])

            for entity in entities:
                md += text[pos : entity["start"]]
                md += TrainingDataWriter.generate_entity(text, entity)

After Change


            entities_with_start_and_end = [
                e for e in entities if "start" in e and "end" in e
            ]
            sorted_entities = sorted(
                entities_with_start_and_end, key=operator.itemgetter("start")
            )

            for entity in sorted_entities:
                md += text[pos : entity["start"]]
                md += TrainingDataWriter.generate_entity(text, entity)
                pos = entity["end"]

        md += text[pos:]

        return md
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: RasaHQ/rasa
Commit Name: 791aee867bb9fdc51756074e2f2117c11c843fde
Time: 2021-03-25
Author: joejuzl@gmail.com
File Name: rasa/shared/nlu/training_data/formats/readerwriter.py
Class Name: TrainingDataWriter
Method Name: generate_message


Project Name: RasaHQ/rasa
Commit Name: 74ce55924e820be3cd81fcc105ed4ba6b7225df4
Time: 2021-03-25
Author: joejuzl@gmail.com
File Name: rasa/shared/nlu/training_data/formats/readerwriter.py
Class Name: TrainingDataWriter
Method Name: generate_message


Project Name: WheatonCS/Lexos
Commit Name: ce6ff9a4ccff73a6d7c4392d29e48914347983a0
Time: 2016-05-26
Author: 13501393281@163.com
File Name: processors/analyze/topword.py
Class Name:
Method Name: testgroup