Add literary_form migration bot#446
Open
modi02 wants to merge 2 commits intointernetarchive:masterfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
literary_form migration bot for the Tag Cleanup GSoC project.
This implements the first stage of the genre taxonomy work: classifying Open Library works as Fiction or Nonfiction based on existing subject strings.
Files:
migrate_subjects.py- classification script with conflict resolution logicmappings/literary_form.json- subject string to literary_form mappingsmappings/droppable.json- noise strings to strip before classificationliterary_form_dry_run.jsonl- dry-run output on 100 works (awaiting mentor review)README.md- full documentation and design decisionsCoverage: 29.26% of full corpus (11.9M works) based on initial analysis of 40.79M works dump.
Dry-run results: 97 Fiction, 3 Nonfiction on 100 test works. Both Nonfiction results manually verified as correct (Richard Jefferies biography, Nobel Peace Prize winners biography).
Next steps: Awaiting mentor review of dry-run JSONL before any production writes. @hornc review required before bulk migration (>100 records).
cc @mekarpeles