-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(qg, nli): add description of modules usage
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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']) | ||
``` |