Skip to content

[DO NOT MERGE] Citation prototyping#205

Closed
matt-bernhardt wants to merge 5 commits into
mainfrom
citation-rake-task
Closed

[DO NOT MERGE] Citation prototyping#205
matt-bernhardt wants to merge 5 commits into
mainfrom
citation-rake-task

Conversation

@matt-bernhardt

@matt-bernhardt matt-bernhardt commented Mar 24, 2025

Copy link
Copy Markdown
Member

This change adds a few features that I'm using for development of the new citation detector:

  • Adds a label field to the Term model which will allow us to measure the performance of the legacy citation detector. This includes some new scopes for the Term model to isolate terms that have been labelled true or false.
  • Defines a new /score route that will inspect those labelled terms, and compare the labels to the results of the legacy Detector::Citation class. The approach used is the f1 score, which is an average of the precision and recall scores.
  • In further support of this reporting capability, we create two new rake tasks for citation records - one to bulk export the extracted features, and one to import the labels for a given batch of term records.

The citations:export task can likely be discarded as we can now get features from the GraphQL endpoint of the application, although there may be use cases for a bulk tool rather than individual queries by term.

@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-205 March 24, 2025 21:06 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-205 March 25, 2025 18:04 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-205 March 31, 2025 19:48 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-205 April 3, 2025 15:26 Inactive
@matt-bernhardt matt-bernhardt force-pushed the citation-rake-task branch 2 times, most recently from 66365ab to d59da26 Compare June 16, 2025 20:45
This allows the application to support labelled records for the evaluation of its internal algorithms.

Along with this change, the rake task to load search events - which is how labelled data will be supplied to the application - is updated to support a label field.

This includes a new test to confirm that support, and a new cassette holding labelled data.

Make annotate

Rename migration to maintain date order

Update migration date after rebasing

Run migrations
With the data model and ingestor upgraded, we now build a way for the application to process that labelled data, and calculate an f1 score for the citation detector, and display it in the UI.

Fixup Term#score controller method

Remove debugging from Term controller score method
Tweaks to rake tasks
Import labels by term phrase, not id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants