cb0c025ab87216d35b68a2b4b36d61621acd76ba,deeppavlov/models/ner/slotfill.py,DstcSlotFillingNetwork,infer,#DstcSlotFillingNetwork#,70

Before Change



    @overrides
    def infer(self, instance, *args, **kwargs):
        instance = instance.strip()
        if not len(instance):
            return dict()
        return self.predict_slots(instance.lower())

After Change



    @overrides
    def infer(self, instance, *args, **kwargs):
        instance = instance.strip().lower()
        if not all([ord(c) < 128 for c in instance]):
            print("Non ASCII symbols in the string, returning empty slots", file=sys.stderr)
            return {}

        tokens = tokenize_reg(instance)
        if len(tokens) > 0:
            return self.predict_slots(tokens)
        else:
            return {}

    def interact(self):
        s = input("Type in the message you want to tag: ")
        prediction = self.predict_slots(s)
        print(prediction)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: cb0c025ab87216d35b68a2b4b36d61621acd76ba
Time: 2018-01-31
Author: arkhipov@yahoo.com
File Name: deeppavlov/models/ner/slotfill.py
Class Name: DstcSlotFillingNetwork
Method Name: infer


Project Name: NifTK/NiftyNet
Commit Name: f52cd5865ef1b4440e8da55b8da1214d01529278
Time: 2017-10-09
Author: t.doel@ucl.ac.uk
File Name: niftynet/utilities/filename_matching.py
Class Name: KeywordsMatching
Method Name: from_tuple


Project Name: NervanaSystems/coach
Commit Name: ff816b347d3dc9881e9f9eb857090b618295a0f1
Time: 2018-11-19
Author: 40395873+shadiendrawis@users.noreply.github.com
File Name: setup.py
Class Name:
Method Name:


Project Name: uber/ludwig
Commit Name: 77a010bc4ec97a10dd9de3060744157bedb0e079
Time: 2019-10-10
Author: piero@uber.com
File Name: ludwig/utils/strings_utils.py
Class Name:
Method Name: load_vocabulary