Over 4.7 crores cases are pending in courts across different levels of the judiciary. There are several factors included in this like: a shortage of judges, the slow procedure of trials, and a lot more. Being from a technological domain, we thought of eliminating the redundant steps in the judicial process that is going through an FIR/case document again and again which usually consumes a lot of time at every other case hearing. We don't want to make just another similar/ a slight variant, of an existing project that is made numerous times on social platforms and blogs. We tried something out of expertise and developed PPF. Not only it is unique but also solves this redundant real-life problem of going through the same document again in order to gather information about a case. That's why we made a project that does Optical Character Recognition on the document and then uses Tensorflow's One Deep Neural Network Model (oneDNN) along with Google Translate API to do its work in the most efficient and precise way. As of now, there is no such project dealing with this aspect and we formulated our project in such a manner that it does very accurate OCR and transliteration (translation with context/sentimental analysis). Now let's see how project works:
Step 1: Firstly, you have to upload a PDF file (an FIR) onto the webpage, and then the process will begin. As we have used express and js to handle the routine and backend, js files will be responsible for handling everything.
Step 2: Then the OCR process will begin which will first extract each word from the document Then after some time it will give extracted text (the user will get the pdf to image and text conversion in regional and english language).
Step 3: Then TensorFlow's qna model and then by oneDNN, a neural network graph for each character will be made. Then a model for each regional language will be made and then by the use the AI model (qna model) to ask some questions and accordingly we will get the
We faced a lot of challenges while making this project and here are some of them:
We did not know anything about reading the text of a PDF file, so first we tried out some npm packages like multer & fileuplaod to get the content of a pdf file. But when we were doing so, we were having problems in getting the correct regional language syntax as there were some grammatical misinterpretations and also in that case we can't get the text of a pdf which is composed of images. So, we decided to incorporate OCR so that we can target any kind of pdf and get the text. So, we used Teserract.js for that.
After extracting the text, in some cases the character's size was going beyond 5000 so we have to make chunks and used the concept of promise so that they can be processed at a time without any error.
Now, we want to change the regional content to English so that we can use the qna model to grab information from the pdf. For this purpose, we used Google translate API and we had a hard time how to get the response from it because we have to await the response in the async function.
One of the major challenges was to turn the English content which is forming the object, back into its regional language(only the value has to be changed back whereas the key of the object will be in the English language). So, we translated each output one by one and chained up them in an await ladder.
(We are proud of the fact that we pulled off a very unique project this weekend which is more than just a web app because it will leverage the power of AI/ML to elevate the judicial system by helping a bit.)
Technologies used
Discussion