Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bertopic/_bertopic.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from typing import Literal
else:
from typing_extensions import Literal
from typing import List, Tuple, Union, Mapping, Any, Callable, Iterable
from typing import List, Tuple, Union, Mapping, Any, Callable, Iterable, Optional, Dict

# Models
try:
Expand Down Expand Up @@ -4082,8 +4082,8 @@ def _extract_representative_docs(
topics: Mapping[str, List[Tuple[str, float]]],
nr_samples: int = 500,
nr_repr_docs: int = 5,
diversity: float = None,
) -> Union[List[str], List[List[int]]]:
diversity: Optional[float] = None,
) -> Tuple[Dict[str, List[str]], List[str], List[List[int]], List[List[int]]]:
"""Approximate most representative documents per topic by sampling
a subset of the documents in each topic and calculating which are
most representative to their topic based on the cosine similarity between
Expand Down
Loading