|
78 | 78 | ],
|
79 | 79 | )
|
80 | 80 |
|
81 |
| -Propose = namedtuple("Propose", ["question", "text_chunk"]) |
| 81 | +Proposal = namedtuple("Proposal", ["question", "text_chunk"]) |
82 | 82 |
|
83 | 83 |
|
84 | 84 | @dataclass
|
@@ -302,9 +302,9 @@ def _embed_nodes(self, nodes: t.List[BaseNode]) -> t.Dict[str, t.List[float]]:
|
302 | 302 |
|
303 | 303 | return embeddings
|
304 | 304 |
|
305 |
| - def _make_propose( |
| 305 | + def _make_proposal( |
306 | 306 | self, cur_node: BaseNode, neighbor_nodes: t.List[BaseNode], evolve_type: str
|
307 |
| - ) -> t.Union[Propose, None]: |
| 307 | + ) -> t.Union[Proposal, None]: |
308 | 308 | # Append multiple nodes randomly to remove chunking bias
|
309 | 309 | size = self.rng.integers(1, 3)
|
310 | 310 | nodes = (
|
@@ -364,7 +364,7 @@ def _make_propose(
|
364 | 364 | else:
|
365 | 365 | question = self._compress_question(question=question)
|
366 | 366 |
|
367 |
| - return Propose(question=question, text_chunk=text_chunk) |
| 367 | + return Proposal(question=question, text_chunk=text_chunk) |
368 | 368 |
|
369 | 369 | def generate(
|
370 | 370 | self,
|
@@ -414,20 +414,20 @@ def generate(
|
414 | 414 |
|
415 | 415 | neighbor_nodes = doc_nodes_map[curr_node.source_node.node_id]
|
416 | 416 |
|
417 |
| - propose = None |
| 417 | + proposal = None |
418 | 418 | try:
|
419 |
| - propose = self._make_propose( |
| 419 | + proposal = self._make_proposal( |
420 | 420 | curr_node, neighbor_nodes, evolve_type
|
421 | 421 | )
|
422 | 422 | except Exception as e:
|
423 | 423 | err_cause = e.__cause__
|
424 | 424 | if not isinstance(err_cause, retry_errors):
|
425 | 425 | raise e
|
426 | 426 |
|
427 |
| - if propose is None: |
| 427 | + if proposal is None: |
428 | 428 | continue
|
429 |
| - question = propose.question |
430 |
| - text_chunk = propose.text_chunk |
| 429 | + question = proposal.question |
| 430 | + text_chunk = proposal.text_chunk |
431 | 431 |
|
432 | 432 | is_valid_question = self._filter_question(question)
|
433 | 433 | if is_valid_question:
|
|
0 commit comments