<commit_before>.. This file is part of TimeSide
   @author: <NAME>

===============
Data management
===============

TimeSide offers various ways to access to audio data or metadata. `AnalyzerResult` is the python data structure where TimeSide embeds all the data resulting from a given analyzer processors after a run. It is thus the base object to access the analysis results and all the corresponding metadata. Bellow are some examples of use of the AnalyzerResult object and some of its methods.

Usage : AnalyzerResult(data_mode=None, time_mode=None)

Four different *time_mode* can be specified :

- 'framewise' : data are returned on a frame basis (i.e. with specified blocksize, stepsize and framerate)
- 'global' : a global data value is return for the entire audio item
- 'segment' : data are returned on a segmnet basis (i.e. with specified start time and duration)
- 'event' :  data are returned on a segment basis (i.e. with specified start time)

Two different *data_mode* can be specified :

- 'value' : data are returned as numpy Array of arbitrary type
- 'label' : data are returned as label indexes (specified by the label_metadata key)

Default values are *time_mode = 'framewise'* and *data_mode = 'value'*

See : :func:`timeside.core.analyzer.AnalyzerResult`, :class:`timeside.core.analyzer.AnalyzerResult`

Default
=======

Create a new analyzer result without default arguments

   >>> from timeside.core.analyzer import AnalyzerResult
   >>> res = AnalyzerResult()


   >>> res.keys()
   ['id_metadata', 'data_object', 'audio_metadata', 'parameters']

   >>> for key,value in res.items():
   ...     print '%s : %s' % (key, value)
   ...
   id_metadata : {'description': '', 'author': '', 'version': '', 'date': '', 'proc_uuid': '', 'id': '', 'unit': '', 'name': ''}
   data_object : {'y_value': array([], dtype=float64), 'value': array([], dtype=float64), 'frame_metadata': {'blocksize': None, 'samplerate': None, 'stepsize': None}}
   audio_metadata : {'sha1': '', 'is_segment': None, 'uri': '', 'channels': None, 'start': 0, 'channelsManagement': '', 'duration': None}
   parameters : {}


Specification of time_mode
==========================
Four different time_mode can be specified :

- 'framewise' : data are returned on a frame basis (i.e. with specified blocksize, stepsize and framerate)
- 'global' : a global data value is return for the entire audio item
- 'segment' : data are returned on a segmnet basis (i.e. with specified start time and duration)
- 'event' :  data are returned on a segment basis (i.e. with specified start time)


Framewise<commit_msg>Fix simple typo: segmnet -> segment<commit_after>.. This file is part of TimeSide
   @author: <NAME>

===============
Data management
===============

TimeSide offers various ways to access to audio data or metadata. `AnalyzerResult` is the python data structure where TimeSide embeds all the data resulting from a given analyzer processors after a run. It is thus the base object to access the analysis results and all the corresponding metadata. Bellow are some examples of use of the AnalyzerResult object and some of its methods.

Usage : AnalyzerResult(data_mode=None, time_mode=None)

Four different *time_mode* can be specified :

- 'framewise' : data are returned on a frame basis (i.e. with specified blocksize, stepsize and framerate)
- 'global' : a global data value is return for the entire audio item
- 'segment' : data are returned on a segment basis (i.e. with specified start time and duration)
- 'event' :  data are returned on a segment basis (i.e. with specified start time)

Two different *data_mode* can be specified :

- 'value' : data are returned as numpy Array of arbitrary type
- 'label' : data are returned as label indexes (specified by the label_metadata key)

Default values are *time_mode = 'framewise'* and *data_mode = 'value'*

See : :func:`timeside.core.analyzer.AnalyzerResult`, :class:`timeside.core.analyzer.AnalyzerResult`

Default
=======

Create a new analyzer result without default arguments

   >>> from timeside.core.analyzer import AnalyzerResult
   >>> res = AnalyzerResult()


   >>> res.keys()
   ['id_metadata', 'data_object', 'audio_metadata', 'parameters']

   >>> for key,value in res.items():
   ...     print '%s : %s' % (key, value)
   ...
   id_metadata : {'description': '', 'author': '', 'version': '', 'date': '', 'proc_uuid': '', 'id': '', 'unit': '', 'name': ''}
   data_object : {'y_value': array([], dtype=float64), 'value': array([], dtype=float64), 'frame_metadata': {'blocksize': None, 'samplerate': None, 'stepsize': None}}
   audio_metadata : {'sha1': '', 'is_segment': None, 'uri': '', 'channels': None, 'start': 0, 'channelsManagement': '', 'duration': None}
   parameters : {}


Specification of time_mode
==========================
Four different time_mode can be specified :

- 'framewise' : data are returned on a frame basis (i.e. with specified blocksize, stepsize and framerate)
- 'global' : a global data value is return for the entire audio item
- 'segment' : data are returned on a segment basis (i.e. with specified start time and duration)
- 'event' :  data are returned on a segment basis (i.e. with specified start time)


Framewise
{'fraction_non_alphanumeric': 0.14102072141212588, 'fraction_numerical': 0.0023023791250959325, 'mean_word_length': 4.528101802757158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7236934', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1435, 'n_words': 617}