0e2a7f6d85a341959eba41d65019b2566084b406,inference.py,,inference,#Any#Any#,184

Before Change



// Main inference function
def inference(question, include_blacklisted = True):
    answers = inference_helper(tokenize(question))[0]
    answers = detokenize(answers)
    answers = replace_in_answers(answers, "answers")
    answers_score = score_answers(answers, "answers")

    best_index, best_score = get_best_score(answers_score, include_blacklisted)

    return {"answers": answers, "scores": answers_score, "best_index": best_index, "best_score": best_score}

// Internal inference function (for direct call)
def inference_internal(question):
    answers = inference_helper(tokenize(question))[0]

After Change


    if len(answers_list) == 1:
        return answers_list[0]
    else:
        return answers_list

// Internal inference function (for direct call)
def inference_internal(questions):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: daniel-kukiela/nmt-chatbot
Commit Name: 0e2a7f6d85a341959eba41d65019b2566084b406
Time: 2017-12-03
Author: daniel@kukiela.pl
File Name: inference.py
Class Name:
Method Name: inference


Project Name: allenai/allennlp
Commit Name: bb1b1c6e27b273a66135d02a04232835d5bfc3ca
Time: 2019-11-19
Author: max.del.edu@gmail.com
File Name: allennlp/data/tokenizers/pretrained_transformer_tokenizer.py
Class Name: PretrainedTransformerTokenizer
Method Name: tokenize


Project Name: facebookresearch/ParlAI
Commit Name: a8fe17c97326de98c94f8272011a43e1f37c8da1
Time: 2021-03-19
Author: kshuster@fb.com
File Name: parlai/agents/hugging_face/dict.py
Class Name: HuggingFaceDictionaryAgent
Method Name: txt2vec


Project Name: daniel-kukiela/nmt-chatbot
Commit Name: 0e2a7f6d85a341959eba41d65019b2566084b406
Time: 2017-12-03
Author: daniel@kukiela.pl
File Name: inference.py
Class Name:
Method Name: inference_internal