Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

annotations_functions.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!usr/bin/env python
  2. # -*- coding: utf8 -*-
  3. #
  4. # -----------------------------------------------------------------------------
  5. # File: annotations_functions.py (as part of project URUMETRICS-CODE)
  6. # Created: 08/09/2022 12:42
  7. # Last Modified: 08/09/2022 12:42
  8. # -----------------------------------------------------------------------------
  9. # Author: William N. Havard
  10. # Postdoctoral Researcher
  11. #
  12. # Mail : william.havard@ens.fr / william.havard@gmail.com
  13. #
  14. # Institution: ENS / Laboratoire de Sciences Cognitives et Psycholinguistique
  15. #
  16. # ------------------------------------------------------------------------------
  17. # Description:
  18. # •
  19. # -----------------------------------------------------------------------------
  20. import argparse
  21. import os
  22. from conversational_settings import uru_conversations
  23. from utils import staticvariable
  24. from utils_annotations import _compute_file_acoustic_annotation
  25. @staticvariable(BASE_SETS=['vtc'])
  26. def conversations_annotations(recording_filename, segments, project_path, parser_args=None):
  27. return uru_conversations.get_interactional_sequences(segments).to_dataframe()
  28. @staticvariable(BASE_SETS=['vtc'], RAW_RECORDING_AVAILABLE=True)
  29. def acoustic_annotations(recording_filename, segments, project_path, parser_args):
  30. parser = argparse.ArgumentParser()
  31. parser.add_argument('--target-sr', required=True, default=16_000, type=int,
  32. help='Audio files sampling rate.')
  33. args = parser.parse_args(parser_args)
  34. return _compute_file_acoustic_annotation(
  35. audio_path=os.path.join(project_path, 'recordings', 'raw', recording_filename),
  36. audio_segments=segments,
  37. target_sr=args.target_sr)