{"id":13658751,"url":"https://github.com/duolingo/halflife-regression","last_synced_at":"2025-04-05T02:03:40.260Z","repository":{"id":99678741,"uuid":"60541674","full_name":"duolingo/halflife-regression","owner":"duolingo","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-20T08:26:18.000Z","size":594,"stargazers_count":509,"open_issues_count":7,"forks_count":92,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-03-29T01:03:07.017Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duolingo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-06T16:05:13.000Z","updated_at":"2025-03-27T21:18:43.000Z","dependencies_parsed_at":"2024-08-02T05:16:33.036Z","dependency_job_id":null,"html_url":"https://github.com/duolingo/halflife-regression","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fhalflife-regression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fhalflife-regression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fhalflife-regression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fhalflife-regression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duolingo","download_url":"https://codeload.github.com/duolingo/halflife-regression/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276159,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T05:01:02.301Z","updated_at":"2025-04-05T02:03:40.230Z","avatar_url":"https://github.com/duolingo.png","language":"Python","funding_links":[],"categories":["Python (144)","Related","Deep Learning Projects"],"sub_categories":["Algorithm"],"readme":"# Half-Life Regression\n\nCopyright (c) 2016 [Duolingo, Inc.](https://duolingo.com) MIT License.\n\nHalf-life regression (HLR) is a model for spaced repetition practice, with particular applications to second language acquisition. The model marries psycholinguistic theory with modern machine learning techniques, indirectly estimating the \"half-life\" of words (and potentially any other item or fact) in a student's long-term memory.\n\nThis repository contains a public release of the data and code used for several experiments in the following paper (which introduces HLR):\n\n\u003e B. Settles and B. Meeder. 2016. [A Trainable Spaced Repetition Model for Language Learning](settles.acl16.pdf).\n\u003e In _Proceedings of the Association for Computational Linguistics (ACL)_, pages 1848-1858.\n\nWhen using this data set and/or software, please cite this publication. A BibTeX record is:\n\n```\n@inproceedings{settles.acl16,\n    Author = {B. Settles and B. Meeder},\n    Booktitle = {Proceedings of the Association for Computational Linguistics (ACL)},\n    Pages = {1848--1858},\n    Publisher = {ACL},\n    Title = {A Trainable Spaced Repetition Model for Language Learning},\n    Year = {2016}\n    DOI = {10.18653/v1/P16-1174},\n    URL = {http://www.aclweb.org/anthology/P16-1174}\n}\n```\n\n\n## Software\n\nThe file ``experiment.py`` contains a Python implementation of half-life regression, as well as several baseline spaced repetition algorithms used in Section 4.1 of the paper above. It is implemented in pure Python, and we recommend using [pypy](http://pypy.org/) on large data sets for efficiency. The software creates the subfolder ``results/`` for outputting model predictions on the test partition and induced model weights for inspection.\n\nThe file ``evaluation.r`` implements an R function, ``sr_evaluate()``, which takes a prediction file from the script above and implements the three metrics we use for evaluation: mean absolute error (MAE), area under the ROC curve (AUC), and Spearman correlation for estimated half-life. Significance tests are also included.\n\n\n## Data Set and Format\n\nThe data set is available on [Dataverse](https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/N8XJME) (361 MB). This is a gzipped CSV file containing the 13 million Duolingo student learning traces used in our experiments.\n\nThe columns are as follows:\n\n* ``p_recall`` - proportion of exercises from this lesson/practice where the word/lexeme was correctly recalled\n* ``timestamp`` - UNIX timestamp of the current lesson/practice\n* ``delta`` - time (in seconds) since the last lesson/practice that included this word/lexeme\n* ``user_id`` - student user ID who did the lesson/practice (anonymized)\n* ``learning_language`` - language being learned\n* ``ui_language`` - user interface language (presumably native to the student)\n* ``lexeme_id`` - system ID for the lexeme tag (i.e., word)\n* ``lexeme_string`` - lexeme tag (see below)\n* ``history_seen`` - total times user has seen the word/lexeme prior to this lesson/practice\n* ``history_correct`` - total times user has been correct for the word/lexeme prior to this lesson/practice\n* ``session_seen`` - times the user saw the word/lexeme during this lesson/practice\n* ``session_correct`` - times the user got the word/lexeme correct during this lesson/practice\n\nThe ``lexeme_string`` column contains a string representation of the \"lexeme tag\" used by Duolingo for each lesson/practice (data instance) in our experiments. It has been added for this release to facilitate future research and analysis. Only the ``lexeme_id`` column was used in our original experiments. The ``lexeme_string`` field uses the following format:\n\n```\nsurface-form/lemma\u003cpos\u003e[\u003cmodifiers\u003e...]\n```\n\nWhere ``surface-form`` refers to the inflected form seen in (or intended for) the exercise, ``lemma`` is the uninflected root, ``pos`` is the high-level part of speech, and each of the ``modifers`` encodes a morphological component specific to the surface form (tense, gender, person, case, etc.). A few examples from Spanish:\n\n```\nbajo/bajo\u003cpr\u003e\nblancos/blanco\u003cadj\u003e\u003cm\u003e\u003cpl\u003e\ncarta/carta\u003cn\u003e\u003cf\u003e\u003csg\u003e\nde/de\u003cpr\u003e\ndiario/diario\u003cn\u003e\u003cm\u003e\u003csg\u003e\nellos/prpers\u003cprn\u003e\u003ctn\u003e\u003cp3\u003e\u003cm\u003e\u003cpl\u003e\nes/ser\u003cvbser\u003e\u003cpri\u003e\u003cp3\u003e\u003csg\u003e\nescribe/escribir\u003cvblex\u003e\u003cpri\u003e\u003cp3\u003e\u003csg\u003e\nescribimos/escribir\u003cvblex\u003e\u003cpri\u003e\u003cp1\u003e\u003cpl\u003e\nlee/leer\u003cvblex\u003e\u003cpri\u003e\u003cp3\u003e\u003csg\u003e\nlees/leer\u003cvblex\u003e\u003cpri\u003e\u003cp2\u003e\u003csg\u003e\nleo/leer\u003cvblex\u003e\u003cpri\u003e\u003cp1\u003e\u003csg\u003e\nlibro/libro\u003cn\u003e\u003cm\u003e\u003csg\u003e\nnegra/negro\u003cadj\u003e\u003cf\u003e\u003csg\u003e\npersona/persona\u003cn\u003e\u003cf\u003e\u003csg\u003e\npor/por\u003cpr\u003e\nson/ser\u003cvbser\u003e\u003cpri\u003e\u003cp3\u003e\u003cpl\u003e\nsoy/ser\u003cvbser\u003e\u003cpri\u003e\u003cp1\u003e\u003csg\u003e\ny/y\u003ccnjcoo\u003e\n```\n\nSome tags contain wildcard components, written as ``\u003c*...\u003e``. For example, ``\u003c*sf\u003e`` refers to a \"generic\" lexeme without any specific surface form (e.g., a lexeme tag that represents _all_ conjugations of a verb: \"run,\" \"ran,\" \"running,\" etc.). The ``\u003c*numb\u003e`` modifier subsumes both singular and plural forms of a noun (e.g., \"teacher\" and \"teachers\"). The file ``lexeme_reference.txt`` contains a reference of pos and modifier components used for lexeme tags.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduolingo%2Fhalflife-regression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduolingo%2Fhalflife-regression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduolingo%2Fhalflife-regression/lists"}