Skip to main content

serve-return

Count adult-child conversational turns from any speaker-labelled transcript, by the published five-second rule, and keep no words.

pip install serve-return

Source, tests and the evidence for every number: https://github.com/usv240/volley/tree/main/packages/serve-return

No speaker labels? serve_return.blind reads who is the child and who the adult from the transcript itself, with a model trained on the CHILDES Gleason corpus and shipped in the package. On families it never saw, the day's turn count came within 9.6 percent of the true count in the median session (harness/blind in the repository, https://github.com/usv240/volley/tree/main/harness/blind).

from serve_return import Roles, count_day
from serve_return.blind import relabel

day = count_day(relabel(unlabelled_utterances), Roles.of(adult=["adult"], child=["child"]))
from serve_return import Utterance, Roles, count_day

roles = Roles.of(adult=["Ujwal"], child=["Unknown"])
day = count_day([
    Utterance(start=1790714507.0, speaker="Ujwal", text="What did you build today?"),
    Utterance(start=1790714509.5, speaker="Unknown", text="A tower. It fell."),
    Utterance(start=1790714511.0, speaker="Ujwal", text="How tall was it?"),
], roles)

day.turns              # 2
day.questions_adult    # 2
day.words_discarded    # 13
day.to_dict()          # numbers only; nothing here can hold a word

A turn is one alternation between an adult and a child within five seconds: an adult utterance answered by a child within five seconds of its end, or the reverse. Same-role runs merge first. This is the conversational turn count the developmental studies used (Gilkerson et al., Pediatrics 2018; Romeo et al., Psychological Science 2018), as produced by the LENA system and as hand-counted under "the 5-second pause rule" in the manual comparison in Child Development (doi 10.1111/cdev.13495). LENA is a registered mark of the LENA Foundation; this package implements the published definition and is not affiliated.

What comes out, per hour and per day: turns, who served, responses within the window, median reply time, adult questions, the longest exchange, seconds spoken by each role, utterance counts, and the number of words read and discarded. The only text field in the output is a date.

Labels are yours: a Bee wristband labels the wearer one way and other voices another; CHILDES uses MOT, FAT, CHI. Anything you do not map is ignored, which is what a third adult in the room should be.

MIT. Part of Volley, built for the Build, Ship, Shape: Amazon Developer Hackathon.

Metadata

Release files for serve-return 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serve-return 0.1.0
File Size Uploaded Provenance
serve_return-0.1.0.tar.gz 476.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for serve-return 0.1.0
File Interpreter ABI Platform
serve_return-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 953.2 kB

Release files / serve_return-0.1.0.tar.gz

Download URL serve_return-0.1.0.tar.gz
Size 476.3 kB
Tags Source
SHA-256 checksum
How to use checksums
77ada45a3f50c2c5d9eb2c34755953ded7cb8a4910ba61627f15a98b07450f28
BLAKE2b-256 checksum
How to use checksums
1ef4eb757402868af6417896d492019077927f0def43912f1e481d0ec9c4d599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / serve_return-0.1.0-py3-none-any.whl

Download URL serve_return-0.1.0-py3-none-any.whl
Size 476.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dda639ec779fb64ae83fb5e8f50108e4e87fbf3fe9a55445db227489dac75a42
BLAKE2b-256 checksum
How to use checksums
46160139f59d92565744cc252728a60ad14984ee514ec1567425be68e9c6b11c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Security for serve-return 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page