Skip to content

Commit

Permalink
docs(qg, nli): add description of modules usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Iamhexi committed Sep 18, 2024
1 parent 59fa7b6 commit 5e5b9de
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/nli_usage.md
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
)
```
14 changes: 14 additions & 0 deletions examples/qg_usage.md
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'])
```

0 comments on commit 5e5b9de

Please sign in to comment.