bagustris / Apsipa2019_SpeechText

Repository for code and paper submitted for APSIPA 2019, Lanzhou, China
22 stars 5 forks source link

missed file 'voiced_feat_file_001_001.npy' #12

Open raniaahmed123 opened 1 year ago

bagustris commented 1 year ago

Hi @raniaahmed123,

Use this script to generate that file (with adjustment): https://github.com/bagustris/Apsipa2019_SpeechText/blob/master/code/python_files/save_feature.py

I give the example here: https://cloud.degoo.com/share/Ov563dopNnEW14jN_DeBig. But for other files, you need to generate by yourself.

raniaahmed123 commented 1 year ago

hi bagustris does it mean i should run all python files independently? not just jupyter noteboks? thanks

bagustris commented 1 year ago

Yes, you need to generate the feature file (.npy files) by yourself. Hence, it requires the original IEMOCAP dataset.

raniaahmed123 commented 1 year ago

thank you for your reply :)

raniaahmed123 commented 1 year ago

image

NameError: name 'speech' is not defined

raniaahmed123 commented 1 year ago

when i uncomment this line

speech = np.delete(speeches, (1061, 1430, 1500, 1552, 1566, 1574, 1575, 1576, 1862, 1863, 1864, 1865, 1868, 1869,

NameError: name 'speechs' is not defined

bagustris commented 1 year ago

@raniaahmed123

Use this code instead, https://github.com/bagustris/SER_ICSigSys2019/blob/master/code/python_files/save_feature.py

noadore commented 1 year ago

when i uncomment this line #speech = np.delete(speeches, (1061, 1430, 1500, 1552, 1566, 1574, 1575, 1576, 1862, 1863, 1864, 1865, 1868, 1869,

NameError: name 'speechs' is not defined Did you finally get the file using the link given by the author below, I encountered the same problem, using the following code is the same problem, if you solved it, can you reply to me how you solved it, thank you

bagustris commented 1 year ago

@noadore, can you explicitly show the error message? Using the code given in this repository previously, the error makes sense since there is no speech variable. The code that I pointed out should work since the speech variable is defined in line 45. Afaik, I changed that variable into speeches when removing silent.

noadore commented 1 year ago

@noadore, can you explicitly show the error message? Using the code given in this repository previously, the error makes sense since there is no speech variable. The code that I pointed out should work since the speech variable is defined in line 45. Afaik, I changed that variable into speeches when removing silent.

image I used the above link, reported an error with the above image, and mine has followed the code steps to get data_collected.pickle, thank you for your reply

bagustris commented 1 year ago

@noadore, Check your variable, wheter it is data or data2. These code should be run after getting pickle file (data_collected.pickle).

To obtain the pickle file, you should run mocap_data_collect.py, not the save_feature above.

So, the flow is: data collection (pickle) --> feature extraction --> classification.

noadore commented 1 year ago

@noadore, Check your variable, wheter it is data or data2. These code should be run after getting pickle file (data_collected.pickle).

To obtain the pickle file, you should run mocap_data_collect.py, not the save_feature above.

So, the flow is: data collection (pickle) --> feature extraction --> classification. Thank you very much for your help, I have solved these problems.

pranav-iiitdwd commented 1 year ago

I am having a problem in running the save_feature file. Capture 1 Capture 2

bagustris commented 1 year ago

@pranav-iiitdwd The error says cannot find the file. Check your pickle file. Make sure the pickle file is not empty and contains ['signal'] file as the audio waveforms.

pranav-iiitdwd commented 1 year ago

My pickle file is approx. 2gb in size, certainly not empty. If possible can you share a snap shot of all the packages and versions you have used, or it would also be helpful if you can host these voiced_feat_files else where. I googled the error, and I think the error is related to pydub package, which is required for audiosegment package.

bagustris commented 1 year ago

I give an example in my first comment above (degoo cloud). I write the codes in mid 2019, but I do not remember exactly the version of packages including pydub. Should be the version around that time.

pranav-iiitdwd commented 1 year ago

Is it required to add ffmpeg to path, I have added it to path. What else could the error be.

bagustris commented 1 year ago

If you used the silence removal method, afaik, there are errors when the threshold is higher than maximum amplitude (all signal are removed). Try to use without silence removal first to see if it works (comment on the second seg variable in your code above).

pranav-iiitdwd commented 1 year ago

Yes, it works without sil removal, the generated file has the exact same size as your file hosted in the first comment. Please give me instructions on how to run, with sil removal. What should be the threshhold, and other things.

bagustris commented 1 year ago

Lower the threshold!

threshold = 0.0001 

Should works.

pranav-iiitdwd commented 1 year ago

I set threshold=0.0001 and duration-=0.1 Still having the same error. seg = seg.filter_silence(duration_s=duration, threshold_percentage=threshold) This line gives the error, without this line it works.

bagustris commented 1 year ago

Try to lower the duration too, perhaps duration=0.01.

Also, since there are signals that are lower than thresholds (noisy speech), delete the following instance (or uncomment if you already have it).

## delete noisy speech
speech = np.delete(speeches, (1061, 1430, 1500, 1552, 1566, 1574, 1575, 1576, 1862, 1863, 1864, 1865, 1868, 1869,
                              1875, 1878, 1880, 1883, 1884, 1886, 1888, 1890, 1892, 1893, 1930, 1931, 1932, 1969,
                              1970, 1971, 1975, 1976, 1977, 1979, 1980, 1981, 1984, 1985, 1986, 1987, 1988, 1989, 
                              1990, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2076, 2106, 2110,
                              2177, 2178, 2179, 2180, 2206, 2241, 2242, 2243, 2245, 2246, 2253, 2254, 2262, 2263, 
                              2357, 2358, 2359, 2362, 2368, 2373, 2374, 2418, 2523, 2525, 2526, 2534, 2539, 2542,
                              2549, 2552, 2553, 2554, 2555, 2556, 2561, 2562, 2563, 2564, 2578, 2670, 2671, 2672, 
                              2692, 2694, 2695, 2728, 2733, 2889, 2890, 3034, 3304, 3511, 3524, 3525, 3528, 3655, 
                              3802, 3864, 3930, 4038, 4049, 4051, 4061, 4193, 4241, 4301, 4302, 4307, 4569, 4570), 0)

Reference: https://github.com/bagustris/SER_ICSigSys2019/blob/master/code/python_files/save_feature.py

pranav-iiitdwd commented 1 year ago

Tried, still having the same error.

bagustris commented 1 year ago

Well, the last way I can suggest is to print the i index under the for loop. If it fails from the beginning, the version of the package may be the true source of error.

pranav-iiitdwd commented 1 year ago

Checked it, it fails from the beginning. Will try checking the package versions. Thanks for the help.

bagustris commented 1 year ago

Feel free to post the answer here if you find a solution for the future reader.

pranav-iiitdwd commented 1 year ago

I am having a problem in running the save_feature file. Capture 1 Capture 2

The issue was cleared by installing sox and adding it to path.