Update README.md
Browse files
README.md
CHANGED
|
@@ -67,7 +67,7 @@ We recommend using our library [teapotai](https://pypi.org/project/teapotai/) to
|
|
| 67 |
---
|
| 68 |
|
| 69 |
|
| 70 |
-
### 1. General Question Answering (
|
| 71 |
|
| 72 |
Teapot can be used for general question answering based on a provided context. The model is optimized to respond conversationally and is trained to avoid answering questions that can't be answered from the given context, reducing hallucinations.
|
| 73 |
|
|
@@ -86,7 +86,10 @@ It stands at a height of 330 meters and is one of the most recognizable structur
|
|
| 86 |
|
| 87 |
teapot_ai = TeapotAI()
|
| 88 |
|
| 89 |
-
answer = teapot_ai.query(
|
|
|
|
|
|
|
|
|
|
| 90 |
print(answer) # => "The Eiffel Tower stands at a height of 330 meters. "
|
| 91 |
```
|
| 92 |
|
|
@@ -102,7 +105,10 @@ The Eiffel Tower is a wrought iron lattice tower in Paris, France. It was design
|
|
| 102 |
|
| 103 |
teapot_ai = TeapotAI()
|
| 104 |
|
| 105 |
-
answer = teapot_ai.query(
|
|
|
|
|
|
|
|
|
|
| 106 |
print(answer) # => "I don't have information on the height of the Eiffel Tower."
|
| 107 |
```
|
| 108 |
|
|
@@ -201,7 +207,10 @@ class ApartmentInfo(BaseModel):
|
|
| 201 |
teapot_ai = TeapotAI()
|
| 202 |
|
| 203 |
# Extract the apartment details
|
| 204 |
-
extracted_info = teapot_ai.extract(
|
|
|
|
|
|
|
|
|
|
| 205 |
print(extracted_info) # => ApartmentInfo(rent=2500.0 bedrooms=2 bathrooms=1 phone_number='555-123-4567')
|
| 206 |
```
|
| 207 |
|
|
|
|
| 67 |
---
|
| 68 |
|
| 69 |
|
| 70 |
+
### 1. General Question Answering (QnA)
|
| 71 |
|
| 72 |
Teapot can be used for general question answering based on a provided context. The model is optimized to respond conversationally and is trained to avoid answering questions that can't be answered from the given context, reducing hallucinations.
|
| 73 |
|
|
|
|
| 86 |
|
| 87 |
teapot_ai = TeapotAI()
|
| 88 |
|
| 89 |
+
answer = teapot_ai.query(
|
| 90 |
+
query="What is the height of the Eiffel Tower?",
|
| 91 |
+
context=context
|
| 92 |
+
)
|
| 93 |
print(answer) # => "The Eiffel Tower stands at a height of 330 meters. "
|
| 94 |
```
|
| 95 |
|
|
|
|
| 105 |
|
| 106 |
teapot_ai = TeapotAI()
|
| 107 |
|
| 108 |
+
answer = teapot_ai.query(
|
| 109 |
+
query="What is the height of the Eiffel Tower?",
|
| 110 |
+
context=context
|
| 111 |
+
)
|
| 112 |
print(answer) # => "I don't have information on the height of the Eiffel Tower."
|
| 113 |
```
|
| 114 |
|
|
|
|
| 207 |
teapot_ai = TeapotAI()
|
| 208 |
|
| 209 |
# Extract the apartment details
|
| 210 |
+
extracted_info = teapot_ai.extract(
|
| 211 |
+
ApartmentInfo,
|
| 212 |
+
context=apartment_description
|
| 213 |
+
)
|
| 214 |
print(extracted_info) # => ApartmentInfo(rent=2500.0 bedrooms=2 bathrooms=1 phone_number='555-123-4567')
|
| 215 |
```
|
| 216 |
|