Created
April 28, 2020 14:31
-
-
Save halfak/48227e64684810764b4e7c5dac8a1b96 to your computer and use it in GitHub Desktop.
Sample of labels and words_to_watch
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
| $ bzcat datasets/ptwiki.draft_quality.balanced_3k.with_text.json.bz2 | \ | |
| shuf -n 100 | python demo_ptwiki_w2w.py | sort -k1,1 |
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
| import sys | |
| from revscoring.dependencies import solve | |
| from revscoring.languages import portuguese | |
| from revscoring.utilities.util import read_observations | |
| for ob in read_observations(sys.stdin): | |
| w2w = solve(portuguese.words_to_watch.revision.datasources.matches, cache={'datasource.revision.text': ob['text']}) | |
| print("\t".join(str(v) for v in [ob['draft_quality'], ob['rev_id'], w2w])) |
Author
halfak
commented
Apr 28, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment