CouncilDataProject / CouncilDataProject/cdp-backend
Better method for finding/creating context span of an IndexedEventGram (in event index pipeline)
- Dominant language
- Python
- Stars
- 25
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
[IndexedEventGram](https://github.com/CouncilDataProject/cdp-backend/blob/main/cdp_backend/database/models.py#L744)'s `context_span` provides a surrounding context of the gram. The [current method](https://github.com/CouncilDataProject/cdp-backend/blob/main/cdp_backend/pipeline/event_index_pipeline.py#L241) to find/create the context span is not ideal. Sometimes context span doesn't entirely contain the gram.
### Expected Behavior
The context span should contain the gram in its entirety.
In the intermediary step of [creating n grams](https://github.com/CouncilDataProject/cdp-backend/blob/main/cdp_backend/pipeline/event_index_pipeline.py#L241), keep track of the gram's start index (and maybe end index) in the original sentence so that a context span could be created from these indices.
Contributor guide
Assessment
This issue has not been assessed yet.