Comments (5)
I want to train a model for OCR-correcting output in Vietnamese, so at fist I want to know how to use a pre-trained model
from natas.
We only have a pretrained model for English at the moment, so it will not work with Vietnamese. Natas calls OpenNMT-py on the background, so basically you can use onmt_translate
with your own model, pass it -n_best 10 and filter the results with a dictionary.
from natas.
We only have a pretrained model for English at the moment, so it will not work with Vietnamese. Natas calls OpenNMT-py on the background, so basically you can use
onmt_translate
with your own model, pass it -n_best 10 and filter the results with a dictionary.
Thank you! Can you give me the English pretrained model and tell me how to use it?
from natas.
This is how to use it from Natas:
import natas
natas.ocr_correct_words(["paft", "friendlhip"])
To use it with OpenNMT, you must first download the model.
Then you will need to prepare a text file with the words you want to OCR post-correct so that there is one word per line and each word should be split into characters.
So if you have a sentence cat ran avvay you should produce the following text file ocr_errors.txt
c a t
r a n
a v v a y
Then you can run onmt_translate -model ocr.pt -src ocr_errors.txt -output ocr_fixed.txt -replace_unk -verbose
. This will produce a text file ocr_fixed.txt with the OCR corrections. OpenNMT lets you do all sorts of things in translate, so please refer to their documentation as well.
from natas.
This is how to use it from Natas:
import natas natas.ocr_correct_words(["paft", "friendlhip"])
To use it with OpenNMT, you must first download the model.
Then you will need to prepare a text file with the words you want to OCR post-correct so that there is one word per line and each word should be split into characters.
So if you have a sentence cat ran avvay you should produce the following text file ocr_errors.txt
c a t r a n a v v a y
Then you can run
onmt_translate -model ocr.pt -src ocr_errors.txt -output ocr_fixed.txt -replace_unk -verbose
. This will produce a text file ocr_fixed.txt with the OCR corrections. OpenNMT lets you do all sorts of things in translate, so please refer to their documentation as well.
Thank you! I'll try it
from natas.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from natas.