src.preprocessing.create_events¶
Cluster the documents based on time and event similarity.
Classes
|
Create a narrative graph from the clusters and the memberships. |
- class src.preprocessing.create_events.CreateEvents(period=4)[source]¶
Create a narrative graph from the clusters and the memberships.
- Parameters:
period (
int
) – period around the discard document
-
period:
int
= 4¶
- find_most_similar(candidates, target)[source]¶
Find the most similar candidate around a time period of target.
- Parameters:
candidates (
ndarray
[Any
,dtype
[float64
]]) – the embeddings of the candidates.target (
ndarray
[Any
,dtype
[float64
]]) – the embedding of the discarded document.
- Return type:
int
- Returns:
the index of the most similar candidate.