Represents a query paired with a set of documents.
| 46 | |
| 47 | @dataclasses.dataclass(frozen=False) |
| 48 | class Example: |
| 49 | """Represents a query paired with a set of documents.""" |
| 50 | query: str |
| 51 | docs: typing.Iterable[str] |
| 52 | # TODO(cmalaviya,petershaw): Move this to `metadata`. |
| 53 | original_query: typing.Optional[str] = None |
| 54 | # Scores can be optionally included if the examples are generated from model |
| 55 | # predictions. Indexes of `scores` should correspond to indexes of `docs`. |
| 56 | scores: typing.Optional[typing.Iterable[float]] = None |
| 57 | # Optional metadata. |
| 58 | metadata: typing.Optional[ExampleMetadata] = None |
| 59 | |
| 60 | |
| 61 | def read_examples(filepath): |
no outgoing calls
no test coverage detected
searching dependent graphs…