quarticcat / detypify Goto Github PK
View Code? Open in Web Editor NEWTypst symbol classifier
Home Page: https://detypify.quarticcat.com/
License: MIT License
Typst symbol classifier
Home Page: https://detypify.quarticcat.com/
License: MIT License
We need an extra step to download detypify assets. What's worse is that we should keep in mind and update the assets on detypify upgrade its pre-trained model.
Possible solution: publish and install it via npm: yarn add detypify
import {Detypify} from 'detypify';
console.log((await Detypify.create()).candidates(strokes));
The original training data come from Detexify is in the form of strokes that can be described as follows:
type Point = tuple[float, float, int] # (x, y, timestamp)
type Stroke = list[Point]
type Strokes = list[Stroke]
The implementation of Detexify is KNN where distances are calculated by Greedy DTW. This model is too large to ship with the website. Besides, I don't know how to handle variable-length inputs. Therefore, I found another way.
Current model of Detypify (0.1.0) is naive CNN. It first normalizes strokes (center + scale), then draw them on a 32x32 canvas (pixelated, no anti-aliasing), then CNN. This approach has some drawbacks:
prime.rev
and backslash
very well. Normalization makes them look the same. There might be more such examples.Could a stroke-based model be better? If so, which model should I use?
Or, is there any potential improvement to the current model?
Currently, all training data come from Detexify. The dataset is extremely unbalanced. Some symbols have more than 3900 samples, while some have less than 10 samples. Many uncommon symbols are nearly untrained.
Apart from that, due to the difference between LaTeX and Typst, some Typst symbols don't even have corresponding samples in Detexify's training data. For example, the join
series (there's only \bowtie
).
That is to say, we really need contributions from the community. Here comes the question: I don't know which platform is suitable for this need.
In addition to that, we can probably explore some data augmentation methods to enhance the training set. And unfortunately, I know nothing about that as well.
How to draw a \wp
, ℘) ? At present, it seems that all inputs of the trajectory will be recognized as φ and other results. Is this because the dataset does not contain ℘?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.