{"id":17670211,"url":"https://github.com/rbroc/sbert-align","last_synced_at":"2025-03-30T14:25:19.069Z","repository":{"id":104053619,"uuid":"576196100","full_name":"rbroc/sbert-align","owner":"rbroc","description":"Compute alignment using SentenceBERT","archived":false,"fork":false,"pushed_at":"2023-12-18T08:55:07.000Z","size":11627,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T16:15:25.026Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbroc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-12-09T08:31:13.000Z","updated_at":"2023-12-12T16:27:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2a6320b-9326-4c1b-9a94-4d82b7e3f3a2","html_url":"https://github.com/rbroc/sbert-align","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/rbroc%2Fsbert-align","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbroc%2Fsbert-align/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbroc%2Fsbert-align/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbroc%2Fsbert-align/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbroc","download_url":"https://codeload.github.com/rbroc/sbert-align/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246329512,"owners_count":20759925,"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-10-24T01:23:27.020Z","updated_at":"2025-03-30T14:25:19.049Z","avatar_url":"https://github.com/rbroc.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sbert-align\nCompute parent-child alignment using SentenceBERT\n\n### Usage\n1. Create a virtual environment (not necessary).\n\nYou can do so by typing:\n\n``` \npython3 -m venv PATH_TO_ENV\nsource PATH_TO_ENV/bin/activate\n```\nReplace `PATH_TO_ENV` with path for virtual environment\n\n2. Install requirements\n```pip install -r requirements.txt```\n\n3. Run the `align.py` script.\n\n`python3 align.py --lag 1 --model all-mpnet-base-v2`.\n\nArguments are customizable.\n\nNote that the script will be looking for a `transcripts.txt` or `surrogates.txt` file in the `data` folder, and outputs will be saved in an `outputs` folder.\n\n4. Deactivate once you're done, by running ```deactivate```.\n\n### Output columns\n- Turn metadata: (`ChildID|ID`, `Visit`, `Turn`)\n- `Lag`: 1 if alignment is computed with previous turn, 2 if two turns back. Note that even numbers compute alignment with previous turns from same speaker;\n- `ModelId`: Which SentenceBERT checkpoint we are using, see https://www.sbert.net/docs/pretrained_models.html for available models; \n- `SemanticAlignment`: cosine similarity between sequence encodings;\n- `AlignmentType`: 'child2caregiver' or 'caregiver2child'\n\n### Notes on study 2\n- We keep the second iteration of a conversation, when the Turn ID is repeated\n- Turns where previous index is missing are not coded for current-to-1back alignment, and for 1back-to-2back alignment\n- Turns where the preceding turn does not follow the previous one are not coded for  1back-to-2back alignment\n\n### Potential expansion:\n- Make synthetic raw data for better reproducibility","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbroc%2Fsbert-align","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbroc%2Fsbert-align","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbroc%2Fsbert-align/lists"}