https://github.com/Deep-Learning-101
基於機器閱讀理解和指令微調的統一信息抽取框架之診斷書醫囑資訊擷取分析
https://huggingface.co/spaces/DeepLearning101/OCR101TW
WSL 安裝 PaddleOCR、Windows 10 安裝 PaddleOCR、PalldeOCR v3 微調
一切都是從這個神奇的需求開始的,因為要識別醫療診斷書中的醫囑內容,所以前期處理的OCR識別就非常重要,雖然 PaddleOCR (https://github.com/PaddlePaddle/PaddleOCR) 已經很強,但是卡在很多格式內容或者簡體和繁體字的問題,所以常常OCR識別後的內容就出包,然後導致醫囑的分析也就容易跟著翻車啦 (但BU端才不管你這些呢 >"<);所以只能再次抱著壯士斷腕的決心,再自己標註一次數據了 ! 那麼,值得一提的是,標註NLP的工具可以用標文字蠻不錯的 Doccano (https://github.com/doccano/doccano) 或者是可以標圖像和文字的 Label Studio (https://labelstud.io/),但是要標給OCR用,感覺上還是得用 PPOCRLabelv2。但是因為平常不太可能開著 Ubuntu 來處理這個工作,所以只能先想辦法從 WINDOWS 10 上安裝 WSL (1或2),然後再幫它啟用桌面,然後採遠端桌面登入,接著再來安裝中文輸入法等等;總計有這幾個動作:
- WINDOWS 10 啟用 WSL
- WSL 啟動 Ubuntu 再啟用桌面
- WINDOWS 10 遠端桌面至 WSL 的 Ubuntu
- 安裝 PaddleOCR、PPOCRLabelv2
- 幫 WSL 的 Ubuntu 安裝繁體中文輸入法
WINDOWS 10 啟用 WSL
https://apps.microsoft.com/store/detail/ubuntu-22042-lts/9PN20MSR04DW
$ sudo apt install -y xfce4 xrdp xfce4-goodies
再來就是要更新還有安裝遠端桌面和繁體中文輸入法所需套件,安裝xfce4過程中會出現選擇顯示管理DM選擇的提示,建議用lightdm。
$ sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
$ sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini
$ sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini
$ echo xfce4-session > ~/.xsession
# test -x /etc/X11/Xsession && exec /etc/X11/Xsession
# exec /bin/sh /etc/X11/Xsession
startxfce4
$ sudo /etc/init.d/xrdp status
* xrdp-sesman is running
* xrdp is running
- Windows Subsystem for Linux (WSL2) 環境設定
https://hackmd.io/@billsun/BJByCIUHf - WSL 2 快速使用指南 (含 GUI 及遠端桌面)
https://magicjackting.pixnet.net/blog/post/226406683 - [設定摘要] Windows 10 WSL2 執行 Linux GUI (XFCE)
https://www.kenming.idv.tw/win10-wsl2_install_linux-gui-xfce/ - WSL2使用xrdp實現圖形桌面
https://zhuanlan.zhihu.com/p/149501381 - 在 ubuntu 22.04 LTS 上用 Fcitx5 搭配新酷音
https://mtmatt.page/linux/fcitx5-with-chewing-on-ubuntu-22-04-lts/
接著就是安裝 PaddleOCR 還有 PPOCRLabelv2,每次在做這些工作時,總會想到為何那麼多人在抗中保台,結果放眼望去,台灣都沒相關的數據或者工具套件開源出來?XD
https://github.com/PaddlePaddle/PaddleOCR
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/PPOCRLabel/README_ch.md
https://zhuanlan.zhihu.com/p/523972865
PPv3-OCR自定義數據從訓練到部署
- No module named ‘Polygon‘
https://bbs.huaweicloud.com/blogs/345204 - TypeError: can only concatenate str (not "float")
https://github.com/PaddlePaddle/PaddleOCR/issues/9271 - pip lanms-neo報錯問題
https://blog.csdn.net/weixin_44824428/article/details/129953615 - Microsoft C++ Build Tools
https://visualstudio.microsoft.com/zh-hant/visual-cpp-build-tools/ - 解決qt.qpa.xcb: could not connect to display 問題
https://zhuanlan.zhihu.com/p/604159681 - from matplotlib import pyplot 出錯,居然是OpenCV與PyQT5衝突引起的
https://zhuanlan.zhihu.com/p/421802098 - 解決qt.qpa.xcb: could not connect to display
https://blog.csdn.net/hypc9709/article/details/124238176 - pip安装时unable to execute ‘gcc‘: No such file or directoryerror: command ‘gcc‘ failed with
https://blog.csdn.net/liuyang_xyz/article/details/119257824
Paddle OCR 應用場景開發微調 (官方github FAQ)
Training_0804_latest
------------------------- Overall Results -------------------------
SENT: %Correct=75.51 [H=589, S=191, N=780]
WORD: %Corr=92.91, Acc=90.52, WER: 9.48 [Sub=5.36, Del=1.73, Ins=2.39]
Training_0721_epoch18
------------------------- Overall Results -------------------------
SENT: %Correct=70.77 [H=552, S=228, N=780]
WORD: %Corr=91.30, Acc=89.53, WER: 10.47 [Sub=6.65, Del=2.05, Ins=1.78]
no mark
Training_0804_latest_nomark
------------------------- Overall Results -------------------------
SENT: %Correct=87.63 [H=928, S=131, N=1059]
WORD: %Corr=97.04, Acc=95.96, WER: 4.04 [Sub=2.27, Del=0.69, Ins=1.08]
Training_0721_epoch18_nomark
------------------------- Overall Results -------------------------
SENT: %Correct=83.57 [H=885, S=174, N=1059]
WORD: %Corr=96.27, Acc=95.64, WER: 4.36 [Sub=2.72, Del=1.00, Ins=0.63]