ce01a7984d45412c8dd6d4f202fa20d55a6cd026,custom_intent_parser/tests/test_regex_intent_parser.py,TestRegexEntityExtractor,test_should_get_built_in,#TestRegexEntityExtractor#,104

Before Change


                "slotName": "dummy_slotName"
            },
            {
                "range": (37, 44),
                "value": "dummy_c",
                "entity": "dummy_entity_2"
            }

After Change


        parser = RegexIntentParser(entity_extractor,
                                   built_in_intents=built_in_intents)
        parser = parser.fit(self._dataset)
        texts = {
            "Book me an italian restaurant in NY for 8pm for 2": {
                "text": "Book me an italian restaurant in NY for 8pm for 2",
                "intent": {
                    "name": BuiltInIntent.BookRestaurant.value["name"],
                    "prob": 0.9794680411508389
                },
                "entities": [
                    {
                        u"value": u"an italian restaurant in NY",
                        u"range": (8, 35),
                        u"entity": u"restaurant"
                    },
                    {
                        u"value": u"2",
                        u"range": (48, 49),
                        u"entity": u"partySize"
                    },
                    {
                        u"value": u"for 8pm",
                        u"range": (36, 43),
                        u"entity": u"reservationDatetime"
                    }

                ]
            }
        }

        // When / Then
        for text, expected_parse in texts.iteritems():
            parse = parser.parse(text)
            self.assertEqual(parse["text"], expected_parse["text"])
            self.assertEqual(parse["intent"], expected_parse["intent"])
            self.assertItemsEqual(parse["entities"],
                                  expected_parse["entities"])

    def test_save_and_load(self):
        // Given
        entity_extractor = RegexEntityExtractor().fit(self._dataset)
        parser = RegexIntentParser(entity_extractor).fit(self._dataset)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: snipsco/snips-nlu
Commit Name: ce01a7984d45412c8dd6d4f202fa20d55a6cd026
Time: 2017-02-24
Author: clement.doumouro@snips.ai
File Name: custom_intent_parser/tests/test_regex_intent_parser.py
Class Name: TestRegexEntityExtractor
Method Name: test_should_get_built_in


Project Name: nilearn/nilearn
Commit Name: 986aacd1c7ed2f7000cc9816057f96d59701e066
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: plot_poldrack_space_net.py
Class Name:
Method Name:


Project Name: nilearn/nilearn
Commit Name: 36dd7cf04dcd4e71ca4e1a0086713c51759fd42d
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: plot_poldrack_space_net.py
Class Name:
Method Name: