Spaces:
Runtime error
Runtime error
Update helper_classes.py
Browse files- helper_classes.py +21 -0
helper_classes.py
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
@dataclass
|
| 2 |
class Config:
|
| 3 |
"""Configuration for the language identification pipeline"""
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import torch
|
| 3 |
+
import torchaudio
|
| 4 |
+
import numpy as np
|
| 5 |
+
import pandas as pd
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
from typing import Tuple, Dict, List, Optional, Union
|
| 8 |
+
from dataclasses import dataclass
|
| 9 |
+
from collections import Counter
|
| 10 |
+
import zipfile
|
| 11 |
+
import shutil
|
| 12 |
+
|
| 13 |
+
from speechbrain.pretrained import EncoderClassifier
|
| 14 |
+
from sklearn.model_selection import train_test_split
|
| 15 |
+
from sklearn.linear_model import LogisticRegression
|
| 16 |
+
from sklearn.metrics import classification_report, confusion_matrix
|
| 17 |
+
from imblearn.over_sampling import RandomOverSampler
|
| 18 |
+
|
| 19 |
+
import warnings
|
| 20 |
+
warnings.filterwarnings('ignore')
|
| 21 |
+
|
| 22 |
@dataclass
|
| 23 |
class Config:
|
| 24 |
"""Configuration for the language identification pipeline"""
|