Inspiration

Over 4.7 crore 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, I 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. I 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. I tried something out of expertise and developed PPF. Not only is it unique but it 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 I 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 I formulated the project in such a manner that it does very accurate OCR and transliteration (translation with context/sentimental analysis).

What it does

Step 1: Firstly, you have to upload a PDF file (an FIR) onto the webpage, and then the process will begin. As I 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 of the AI model (qna model) to ask some questions and accordingly, we will get the formulated output with various extracted key-value pairs.

Step 4: As for each pdf the key-value pair will be different, so I handled each case differently and so the fields will vary according to the file chosen.

Step 5: Generally, the user, if needed, can get the judgment analysis by ticking a check mark, and thus he/she will be receiving the most accurate judgment/decision for that pdf.

Step 6: Apart from this, users can harness the power of transliteration and can change the text in any language to English and can also see the most accurate translation of that text.

Challenges I ran into

I faced a lot of challenges while making this project and here are some of them:

  1. I did not know anything about reading the text of a PDF file, so first I tried out some npm packages like multer & fileuplaod to get the content of a pdf file. But when I was doing so, I was having problems in getting the correct regional language syntax as there were some grammatical misinterpretations and also in that case I can't get the text of a pdf that is composed of images. So, I decided to incorporate OCR so that I can target any kind of pdf and get the text. That is why I used Teserract.js for that.

  2. After extracting the text, in some cases the character's size was going beyond 5000 so I have to make chunks and used the concept of promise so that they can be processed at a time without any error.

  3. Now, I want to change the regional content to English so that I can use the qna model to grab information from the pdf. For this purpose, I used Google translate API and had a hard time how to get the response from it because I have to await the response in the async function.

  4. 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, I translated each output one by one and chained up them on an awaiting ladder.

Accomplishments that I'm proud of

I am proud of the fact that I 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.

What I learned

I learned how to harness the power of TensorFlow's AI model to use the computational power of giving back answers to a question asked from a chunk of text. Integrated and developed a backend that was communicating efficiently with the TensorFlow's input & output and thus providing a soothing experience to the user.

What's next for PPF - The judicial helper

The next aim for this beautiful website/application will be to include more language support to the backend so that more things/FIRs can be processed and the judicial system can be benefitted from this. Also, I want to make a uniform structure for registering an FIR so that the parsing can be the same for each one and the code can be functionalized so that I don't have to make each case for handling the FIRs.

Built With

Share this project:

Updates