CouncilDataProject / CouncilDataProject/cdp-backend

Better method for finding/creating context span of an IndexedEventGram (in event index pipeline)

Open
#143 0 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.