-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error due to lack of resources #11
Comments
マルチプロセスからシングルプロセスに処理を変更
enrich_kana の実行時間をベンチマークしたところ、エラーは発生せず、下記の時間で実行完了した。
|
'pd.read_csv'の引数に
|
pykakasi のインスタンス化をグローバル変数化して、関数実行毎にインスタンス化しないように変更。
|
既にフリガナになっている値については、pykakasiによる処理をスキップさせることで高速化を図る。 if re.fullmatch(r"[ァ-ヴー]+", cleaned_text):
return cleaned_text
else:
return "".join(item['kana'] for item in kks.convert(cleaned_text)) 50%くらいの処理時間に短縮
|
pandarallelを使った df['std_furigana'] = df['std_furigana'].parallel_apply(_normalize_and_convert_kana) AMD Ryzen 7 7735U (8 cores) で、実行時間が1/5に。
|
enrich_kana
関数を実行すると下記のエラーが発生して処理が完了しない。The text was updated successfully, but these errors were encountered: