|
17 | 17 |
|
18 | 18 |
|
19 | 19 | def eval_data_from_json( |
20 | | - filename: str, max_docs: Union[int, bool] = None, preprocessor: PreProcessor = None, open_domain: bool = False |
| 20 | + filename: str, |
| 21 | + max_docs: Optional[Union[int, bool]] = None, |
| 22 | + preprocessor: Optional[PreProcessor] = None, |
| 23 | + open_domain: bool = False, |
21 | 24 | ) -> Tuple[List[Document], List[Label]]: |
22 | 25 | """ |
23 | 26 | Read Documents + Labels from a SQuAD-style file. |
@@ -58,8 +61,8 @@ def eval_data_from_json( |
58 | 61 | def eval_data_from_jsonl( |
59 | 62 | filename: str, |
60 | 63 | batch_size: Optional[int] = None, |
61 | | - max_docs: Union[int, bool] = None, |
62 | | - preprocessor: PreProcessor = None, |
| 64 | + max_docs: Optional[Union[int, bool]] = None, |
| 65 | + preprocessor: Optional[PreProcessor] = None, |
63 | 66 | open_domain: bool = False, |
64 | 67 | ) -> Generator[Tuple[List[Document], List[Label]], None, None]: |
65 | 68 | """ |
@@ -123,7 +126,7 @@ def squad_json_to_jsonl(squad_file: str, output_file: str): |
123 | 126 |
|
124 | 127 |
|
125 | 128 | def _extract_docs_and_labels_from_dict( |
126 | | - document_dict: Dict, preprocessor: PreProcessor = None, open_domain: bool = False |
| 129 | + document_dict: Dict, preprocessor: Optional[PreProcessor] = None, open_domain: bool = False |
127 | 130 | ): |
128 | 131 | """ |
129 | 132 | Set open_domain to True if you are trying to load open_domain labels (i.e. labels without doc id or start idx) |
|
0 commit comments