월간 데이콘 영어 음성 국적 분류 AI 경진대회

[baseline] 데이콘 베이스라인 코드 (librosa, keras)

2021.05.17 12:11 7,279 조회 language

안녕하세요. 데이콘입니다.

데이콘 베이스라인은 참가자의 제출을 최우선으로 하고 있습니다.

상세한 기법의 질문은 토론게시판을 통해 해주시면 감사하겠습니다.

감사합니다. 
데이콘 드림

코드
로그인이 필요합니다
0 / 1000
Ajit
2021.05.20 17:11

Hi,
There are two changes required in get_id () to run this with Linux file path:
#current code
def get_id(data):
    return np.int(data.split("\\")[1].split(".")[0])
#new code after change
def get_id(data):
    return np.int(data.split("/")[-1].split(".")[0])

Still I am wondering , how previous code is working with data.split("\\")[1].split(".")[0] where the index for first split should be -1 to get the filename.

DACONIO
2021.05.21 13:02

안녕하세요 Ajit님

정보 공유 감사합니다.

감사합니다.

조시헌
2021.05.21 13:41

삭제된 댓글입니다

JY100
2021.05.21 19:48

path id
0 ./open/test\1.wav 1
1 ./open/test\10.wav 10
2 ./open/test\100.wav 100
3 ./open/test\1000.wav 1000
4 ./open/test\1001.wav 1001

as u can see in above table,  path contains  both '/' and '\'
so, path.split('\\') contains only two elements

str_ = './open/test\\1.wav'
print(str_.split('\\'))
>> ['./open/test', '1.wav']

like this!
I hope this can help you :).

짠규
2021.06.24 17:45

data.split("\\")[-1] is exactly same to data.split("\\")[0]  because it has only 1 elements : './open/test/*.wav'

if you try  like this,
 file_path_str.split('\\')[1]
you'll receive "Index Error: list index out of range"

TREX99
2021.06.01 23:06

australia_train_data = np.load("./npy_data/australia_npy.npy", allow_pickle = True)
canada_train_data = np.load("./npy_data/australia_npy.npy", allow_pickle = True)

요거 데이타를 잘못 불러오신 듯...둘째줄 말입니다만..캐나다인데...오스트레일리아 데이타를 가져오신거 맞죠 ?

DACONIO
2021.06.02 09:49

내용 수정했습니다.
오류 발견해 주셔서 감사합니다.

차가운호박
2022.10.11 11:41

build_fn()에 대한 학습과정에서 에러 메시지로 
TypeError: raw_input() got an unexpected keyword argument 'shape' 가 뜨는데

혹시 이유를 알 수 있나요