You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For audio tasks, you'll need a [feature extractor](main_classes/feature_extractor) to prepare your dataset for the model. The feature extractor is designed to extract features from raw audio data, and convert them into tensors.
217
+
오디오 작업에는 데이터셋을 모델에 준비하기 위해 [특징 추출기](main_classes/feature_extractor)가 필요합니다. 특징 추출기는 원시 오디오 데이터에서 피처를 추출하고 이를 텐서로 변환하는 것이 목적입니다.
218
218
219
-
Load the [MInDS-14](https://huggingface.co/datasets/PolyAI/minds14)dataset (see the 🤗 [Datasets tutorial](https://huggingface.co/docs/datasets/load_hub.html) for more details on how to load a dataset) to see how you can use a feature extractor with audio datasets:
219
+
오디오 데이터셋에 특징 추출기를 사용하는 방법을 보려면 [MInDS-14](https://huggingface.co/datasets/PolyAI/minds14)데이터셋을 가져오세요. (데이터셋을 가져오는 방법은 🤗 [Datasets tutorial](https://huggingface.co/docs/datasets/load_hub.html)에서 자세히 설명하고 있습니다).
Access the first element of the `audio`column to take a look at the input. Calling the `audio`column automatically loads and resamples the audio file:
227
+
`audio`열의 첫 번째 요소에 액세스하여 입력을 살펴보세요. `audio`열을 호출하면 오디오 파일을 자동으로 가져오고 리샘플링합니다:
228
228
229
229
```py
230
230
>>> dataset[0]["audio"]
@@ -234,21 +234,22 @@ Access the first element of the `audio` column to take a look at the input. Call
234
234
'sampling_rate': 8000}
235
235
```
236
236
237
-
This returns three items:
237
+
이렇게 하면 세 가지 항목이 반환됩니다:
238
238
239
-
*`array` is the speech signal loaded - and potentially resampled - as a 1D array.
240
-
*`path` points to the location of the audio file.
241
-
*`sampling_rate` refers to how many data points in the speech signal are measured per second.
239
+
*`array`는 1D 배열로 가져와서 (필요한 경우) 리샘플링된 음성 신호입니다.
240
+
*`path`는 오디오 파일의 위치를 가리킵니다.
241
+
*`sampling_rate`는 음성 신호에서 초당 측정되는 데이터 포인트 수를 나타냅니다.
242
242
243
-
For this tutorial, you'll use the [Wav2Vec2](https://huggingface.co/facebook/wav2vec2-base) model. Take a look at the model card, and you'll learn Wav2Vec2 is pretrained on 16kHz sampled speech audio. It is important your audio data's sampling rate matches the sampling rate of the dataset used to pretrain the model. If your data's sampling rate isn't the same, then you need to resample your data.
243
+
이 튜토리얼에서는 [Wav2Vec2](https://huggingface.co/facebook/wav2vec2-base) 모델을 사용합니다. 모델 카드를 보면 Wav2Vec2가 16kHz 샘플링된 음성 오디오를 기반으로 사전 학습된 것을 알 수 있습니다.
244
+
모델을 사전 학습하는 데 사용된 데이터셋의 샘플링 속도와 오디오 데이터의 샘플링 속도가 일치해야 합니다. 데이터의 샘플링 속도가 다르면 데이터를 리샘플링해야 합니다.
244
245
245
-
1.Use 🤗 Datasets'[`~datasets.Dataset.cast_column`]method to upsample the sampling rate to 16kHz:
246
+
1.🤗 Datasets의[`~datasets.Dataset.cast_column`]메서드를 사용하여 샘플링 속도를 16kHz로 업샘플링하세요:
2.Call the `audio`column again to resample the audio file:
252
+
2.오디오 파일을 리샘플링하기 위해 `audio`열을 다시 호출합니다:
252
253
253
254
```py
254
255
>>> dataset[0]["audio"]
@@ -258,17 +259,18 @@ For this tutorial, you'll use the [Wav2Vec2](https://huggingface.co/facebook/wav
258
259
'sampling_rate': 16000}
259
260
```
260
261
261
-
Next, load a feature extractor to normalize and pad the input. When padding textual data, a `0` is added for shorter sequences. The same idea applies to audio data. The feature extractor adds a `0` - interpreted as silence - to `array`.
262
+
다음으로, 입력을 정규화하고 패딩하는 특징 추출기를 가져오세요. 텍스트 데이터의 경우, 더 짧은 시퀀스에 대해 `0`이 추가됩니다. 오디오 데이터에도 같은 개념이 적용됩니다.
263
+
특징 추출기는 배열에 대해 `0`(묵음으로 해석)을 추가합니다.
262
264
263
-
Load the feature extractor with [`AutoFeatureExtractor.from_pretrained`]:
265
+
[`AutoFeatureExtractor.from_pretrained`]를 사용하여 특징 추출기를 가져오세요:
Pass the audio `array` to the feature extractor. We also recommend adding the `sampling_rate`argument in the feature extractor in order to better debug any silent errors that may occur.
273
+
오디오 `array`를 특징 추출기에 전달하세요. 또한, 특징 추출기에 `sampling_rate`인자를 추가하여 발생할 수 있는 silent errors(즉각적인 오류 메시지가 발생하지 않는 오류)를 더 잘 디버깅하는 것을 권장합니다.
272
274
273
275
```py
274
276
>>> audio_input = [dataset[0]["audio"]["array"]]
@@ -277,7 +279,7 @@ Pass the audio `array` to the feature extractor. We also recommend adding the `s
Just like the tokenizer, you can apply padding or truncation to handle variable sequences in a batch. Take a look at the sequence length of these two audio samples:
282
+
토크나이저와 마찬가지로 배치 내에서 가변적인 시퀀스를 처리하기 위해 패딩 또는 생략을 적용할 수 있습니다. 이 두 개의 오디오 샘플의 시퀀스 길이를 확인해보세요:
281
283
282
284
```py
283
285
>>> dataset[0]["audio"]["array"].shape
@@ -287,7 +289,7 @@ Just like the tokenizer, you can apply padding or truncation to handle variable
287
289
(106496,)
288
290
```
289
291
290
-
Create a function to preprocess the dataset so the audio samples are the same lengths. Specify a maximum sample length, and the feature extractor will either pad or truncate the sequences to match it:
292
+
오디오 샘플의 길이가 동일하도록 데이터셋을 전처리하는 함수를 만들어 보세요. 최대 샘플 길이를 지정하면, 특징 추출기가 해당 길이에 맞춰 시퀀스를 패딩하거나 생략합니다:
291
293
292
294
```py
293
295
>>>defpreprocess_function(examples):
@@ -302,13 +304,13 @@ Create a function to preprocess the dataset so the audio samples are the same le
302
304
...return inputs
303
305
```
304
306
305
-
Apply the `preprocess_function` to the the first few examples in the dataset:
0 commit comments