Comments (7)
Hmm I think using python2.7 will solve this, or
try with io.open(file_path_dest,"r",encoding='ascii')
?
from im2markup.
Yes it's the same. You can also found processed data at http://lstm.seas.harvard.edu/latex/data/
from im2markup.
@da03 , oh, it worked!
Thanks a lot!
from im2markup.
Hi, @da03 , I want to confirm whether the processing in this repo is the same process in the paper, Image-to-Markup Generation with Coarse-to-Fine Attention?
from im2markup.
Wow, it is great. I hope to follow your work to do some research.
And I guess, these two .gz
files are the same, am I right?
from im2markup.
with io.open(file_path_dest,"r",encoding='ascii')
still not work at python3.7 env
before adjust
with open(temp_file, 'w') as fout:
prepre = open(output_file, 'r').read().replace('\r', ' ') # delete \r
# replace split, align with aligned
prepre = re.sub(r'\\begin{(split|align|alignedat|alignat|eqnarray)\*?}(.+?)\\end{\1\*?}',
r'\\begin{aligned}\2\\end{aligned}', prepre, flags=re.S)
prepre = re.sub(r'\\begin{(smallmatrix)\*?}(.+?)\\end{\1\*?}',
r'\\begin{matrix}\2\\end{matrix}', prepre, flags=re.S)
fout.write(prepre)
after adjust
with open(temp_file, 'w') as fout:
# prepre = open(output_file, 'r').read().replace('\r', ' ') # delete \r
prepre = io.open(output_file, 'r', encoding='ascii').read().replace(
'\r', ' ') # delete \r
# replace split, align with aligned
prepre = re.sub(r'\\begin{(split|align|alignedat|alignat|eqnarray)\*?}(.+?)\\end{\1\*?}',
r'\\begin{aligned}\2\\end{aligned}', prepre, flags=re.S)
prepre = re.sub(r'\\begin{(smallmatrix)\*?}(.+?)\\end{\1\*?}',
r'\\begin{matrix}\2\\end{matrix}', prepre, flags=re.S)
fout.write(prepre)
show error
2022-04-23 16:52:56,976 root INFO Script being executed: preprocess_formulas.py
2022-04-23 16:52:56,976 root INFO Script being executed: preprocess_formulas.py
Traceback (most recent call last):
File "preprocess_formulas.py", line 103, in <module>
main(sys.argv[1:])
File "preprocess_formulas.py", line 66, in main
prepre = io.open(output_file, 'r', encoding='ascii').read().replace(
File "/home/yhtao/anaconda3/envs/latex_ocr/lib/python3.7/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 854136: ordinal not in range(128)
from im2markup.
@TITC this work for me io.open(output_file, 'r', encoding='latin-1')
from im2markup.
Related Issues (20)
- - HOT 1
- not working for below type of images (other than given by you). I think we need to put images in particular format HOT 8
- can anyone share the trained model file which is genralized on any type of image like mathpix HOT 3
- [Please Respond] Can you help me training the model for to recognize the out of given data image set HOT 1
- how to remove katex parser error HOT 1
- target vocab size HOT 5
- There is a bug in preprocess_latex.js HOT 3
- error importation cudnn HOT 20
- [regarding real dataset] Please respond HOT 18
- I am getting None with intermediate weights HOT 1
- How to make code show predicted mathematical expression in latex format HOT 1
- can you explain about value 'Accuracy'?
- why downsample by 2 in preprocess HOT 2
- Why using lua instead of python? HOT 1
- can you explain src\modeel\cnn.lua
- Getting low accuracy using customized images for test. HOT 2
- 'perl' and 'cat' is not recognized
- Can you provide a vocab dictionary?
- The python version of the dataset resource is not working
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 im2markup.