Skip to content

Commit

Permalink
Store sentence IDs in the correct named entity field
Browse files Browse the repository at this point in the history
Prior to this change, when named entities were created, their appearing
sentence wasn’t being associated because we were trying to store its ID
in `sentenceId` instead of `sentence_id`, the latter of which is the
actual Postgres column name.

However, by explictly snake-casing at this point, we may be breaking
some of the correct stitching of snake-cased Postgres fields to
camelCased object attributes, and so we need to debug whether this is
all associated together correctly by Sequelize and queryable by GraphQL.

Affects #49
  • Loading branch information
reefdog committed Mar 28, 2019
1 parent da13b57 commit 86aae41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/workers/openedCaptions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async function processSentence(content) {
ents.map(ent => models.NamedEntity.create({
entity: sentence.substring(ent.start, ent.end),
type: ent.label,
sentenceId: storedSentence.id,
sentence_id: storedSentence.id,
model: 'en_core_web_lg',
}))
}
Expand Down

0 comments on commit 86aae41

Please sign in to comment.