<jupyter_start><jupyter_text>Generate spectrogram- view docstrings for more info<jupyter_code>### parameters
n_fft=4096
hop_length_ms=1
win_length_ms=4
ref_level_db=20
pre=0.97
min_level_db=-80
silence_threshold = 0.01
min_silence_for_spec=0.1
max_vocal_for_spec=1.0,
min_syllable_length_s = 0.01
spectral_range = [500, 20000]
mask_thresh_std = 1.0
neighborhood_thresh=0.25
max_element_len_ms=2000
neighborhood_time_ms=5
neighborhood_freq_hz=2000
temporal_neighbor_merge_distance_ms= 0
overlapping_element_merge_thresh= 0.25
min_element_size_ms_hz = [5, 500]
spec = spectrogram(
    data,
    rate,
    n_fft=n_fft,
    hop_length_ms=hop_length_ms,
    win_length_ms=win_length_ms,
    ref_level_db=ref_level_db,
    pre=pre,
    min_level_db=min_level_db,
)
np.shape(spec)
fig, ax = plt.subplots(figsize=figsize)
plot_spec(spec, fig, ax);<jupyter_output><empty_output><jupyter_text>segment vocalization using continuity segmenation<jupyter_code>from vocalseg.continuity_filtering import continuity_segmentation
results = continuity_segmentation(
    data,
    rate,
    n_fft=n_fft,
    hop_length_ms=hop_length_ms,
    win_length_ms=win_length_ms,
    ref_level_db=ref_level_db,
    pre=pre,
    min_level_db=min_level_db,
    verbose=True,
    spectral_range = spectral_range,
    mask_thresh_std = mask_thresh_std,
    figsize=figsize,
    neighborhood_thresh=neighborhood_thresh,
    max_element_len_ms = max_element_len_ms,
    neighborhood_time_ms=neighborhood_time_ms,
    neighborhood_freq_hz=neighborhood_freq_hz,
    temporal_neighbor_merge_distance_ms= temporal_neighbor_merge_distance_ms,
    overlapping_element_merge_thresh= overlapping_element_merge_thresh,
    min_element_size_ms_hz = min_element_size_ms_hz
)
print(results['min_level_db'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0743847874720358, 'fraction_numerical': 0.0296420581655481, 'mean_word_length': 7.022421524663677, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '642154', 'license': 'MIT', 'n_tokens_mistral': 744, 'n_tokens_neox': 706, 'n_words': 88, 'path': 'notebooks/continuity_segmentation-canary.ipynb', 'repo_name': 'timsainb/vocalization-segmentation', 'size': '1788'}