From 5e5b9de256b0aec72d271ff21c88cfc89e902220 Mon Sep 17 00:00:00 2001 From: Iamhexi Date: Wed, 18 Sep 2024 20:40:45 +0000 Subject: [PATCH] docs(qg, nli): add description of modules usage --- examples/nli_usage.md | 17 +++++++++++++++++ examples/qg_usage.md | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 examples/nli_usage.md create mode 100644 examples/qg_usage.md diff --git a/examples/nli_usage.md b/examples/nli_usage.md new file mode 100644 index 0000000..a6a816a --- /dev/null +++ b/examples/nli_usage.md @@ -0,0 +1,17 @@ +# Natural Language Inference module - usage + +To use Natural Language Inference(**NLI** module), import it, and use `infer()` function (to get probabilities of different relationships between `premise` and `hypothesis`) or infer_relation()` function (to just get the most probable relationship). + +```python +from knowledge_verificator.nli import infer_relation + +if __name__ == '__main__': + premise = input("Premise: ") + hypothesis = input("Hypothesis: ") + print( + infer_relation( + premise=premise, + hypothesis=hypothesis + ).value + ) +``` \ No newline at end of file diff --git a/examples/qg_usage.md b/examples/qg_usage.md new file mode 100644 index 0000000..0e3898c --- /dev/null +++ b/examples/qg_usage.md @@ -0,0 +1,14 @@ +# Question Generation module - usage + +To use Question Generation (**QG** module), import it, and use `generate()` method. + +```python +from knowledge_verificator.qg import QuestionGeneration + +if __name__ == '__main__': + context = input('Provide context: ') + answer = input('Answer: ') + QG = QuestionGeneration() + qa = QG.generate(answer, context) + print(qa['question']) +``` \ No newline at end of file