Skip to content

Commit a470c81

Browse files
Update README.md
1 parent 0145de7 commit a470c81

File tree

1 file changed

+173
-0
lines changed

1 file changed

+173
-0
lines changed

README.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,176 @@ SplicerAi Intelligent Document Analysis SDK Specially designed for native ANDROI
66

77
## SplicerAi Intelligent Document Analysis SDK v2
88
QuickCapture Mobile Scanning SDK Specially designed for native ANDROID from [Extrieve](https://www.extrieve.com/).
9+
10+
# SplicerAi SDK – Intelligent Document Analysis
11+
12+
SplicerAi is an intelligent document analysis SDK offering the following functionalities:
13+
14+
1. **Document Identification / Classification** : *Identification and categorization of documents*.
15+
2. **Document Data Extraction** : *Extraction of textual data from documents*.
16+
3. **Document Masking** : *Specific to Aadhaar documents, ensuring data privacy*.
17+
18+
In SplicerAi, prior to any document analysis, an independent document object needs to be created using the `AiDocument` class provided by the SplicerAi SDK.
19+
```java
20+
//Creating a new document object.
21+
AiDocument DocumentObject = new AiDocument(ImagePath);
22+
//ImagePath - string type - path of document image
23+
```
24+
**DocumentObject** will generate with following properties :
25+
26+
1. **ID** : *Identifier for the unique document object.Can use for further reference*.
27+
2. **TYPE** : *Property to specefy the KYC document type (AADHAAR,PAN etc.)*.
28+
3. **PATH** : *Physical path of the document image file*.
29+
4. **DATA** : *Text/character data will be identified and extract from image*.
30+
31+
**DocumentObject** will be available with following **Methods** :
32+
33+
1. **KYCDetect**
34+
KYCDetect Method from **DocumentObject** will provide the **type of the KYC document** with the document analysis intelligence by SplicerAi.
35+
```java
36+
//KYCDetect will use callback function to return the result.
37+
DocumentObject.KYCDetect(handleKYCDetectCallBack);
38+
function handleKYCDetectCallBack(resultJson) {
39+
//Use detect respose resultJson here
40+
}
41+
//Or use lambda
42+
DocumentObject.KYCDetect(resultJson -> {
43+
//Use detect respose resultJson here
44+
});
45+
```
46+
Once the document type identified same also will be available in the **TYPE** property of **DocumentObject** .Following is the response structure :
47+
```JSON
48+
//Respose JSON data
49+
{
50+
DOCNAME: "<name/type of document>",
51+
Confidence: "<Level of accuracy /High>",
52+
predictedDocs: {
53+
//If any other documents detected,
54+
//Same will list out with the confidence level
55+
Aadhaar: "HIGH"
56+
},
57+
//classification succes or not
58+
CLASSIFICATION: true/false,
59+
}
60+
```
61+
62+
2. **KYCExtract**
63+
ExtractData Method from DocumentObject will provide the extracted data from the provided document in a JSON string format.
64+
```java
65+
//KYCDetect will use callback function to return the result.
66+
DocumentObject.KYCExtract(handleKYCExtractCallBack);
67+
function handleKYCExtractCallBack(resultJson) {
68+
// Code to process the resultJson
69+
}
70+
//Or use lambda
71+
DocumentObject.KYCExtract(resultJson -> {
72+
//Detect respose
73+
});
74+
```
75+
Once the document data extracted, same will be available in the DATA property of DocumentObject.Following is the response structure :
76+
```JSON
77+
{
78+
DOCNAME: "AADHAAR",
79+
Confidence: "High",
80+
predictedDocs: {
81+
Aadhaar: "HIGH"
82+
},
83+
CLASSIFICATION: true,
84+
//Extracted data from KYC document
85+
KEYVALUE: {
86+
NAME: "NAME",
87+
GENDER: "MALE",
88+
DOB: "16/09/1981",
89+
AADHAARNO: "2513 5077 5668",
90+
FILENAME: ""
91+
}
92+
}
93+
```
94+
3. **GetKYCDocList**
95+
GetKYCDocList Method from **DocumentObject** will provide the list of available KYC document.
96+
```java
97+
//GetKYCDocList will return all the possible KYC document types.
98+
String KYCDOcList = DocumentObject.GetKYCDocList();
99+
```
100+
Following is a sample response structure :
101+
```JSON
102+
["AADHAAR","PAN","PASSPORT"]
103+
```
104+
105+
4. **KYCVerify**
106+
KYCVerify Method from **DocumentObject** will verify the KYC document with the **TYPE** provided.
107+
```java
108+
//KYCVerify will use callback function to return the result.
109+
DocumentObject.KYCVerify("PAN",handleKYCVerifytCallBack);
110+
*@param "Type of document to verify can get from GetKYCDocList Method".
111+
*@param "A callback method to capture the KYCVerification response".
112+
113+
function handleKYCVerifyCallBack(resultJson) {
114+
//Process the resultJson
115+
}
116+
117+
//Or use lambda function
118+
DocumentObject.KYCVerify("PAN",resultJson -> {
119+
//Detected response JSON
120+
});
121+
```
122+
123+
Following is a sample response structure :
124+
125+
```JSON
126+
{
127+
STATUS: true/false,
128+
//success/failure
129+
CONFIDENCE : "LOW/MEDIUM/HIGH"
130+
//if STATUS is success
131+
}
132+
```
133+
134+
**AADHAAR MASKING**
135+
136+
SplicerAi also provide an activity based class for AADHAAR MASKING.
137+
```java
138+
//Create a new intent to call aadhaar masking activity.
139+
Intent maskIntent = new Intent(this, Class.forName("com.extrieve.splicer.AadhaarMask"));
140+
//Pass the ID of the document to be masked
141+
maskIntent.putExtra("DOCUMENT_ID",DocumentObject.ID);
142+
//Set the config for Masking options
143+
//Keep the extracted aadhaar number in respose.
144+
Config.AadhaarMasking.ENABLE_AADHAAR_NO = true;
145+
//Set the masking colour
146+
Config.AadhaarMasking.MaskColor = Color.GRAY;
147+
//Launch the activity.
148+
activityResultLauncher.launch(maskIntent);
149+
150+
//Activity launcher registration
151+
ActivityResultLauncher<Intent> activityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),result -> {
152+
//Will get the masked image as a result of the intent
153+
Intent data = result.getData();
154+
//data Will contain repose JSON string
155+
});
156+
```
157+
On AadhaarMask intent call, requires document id of previously created AiDocument Object.
158+
The respose data will be in following structure :
159+
```JSON
160+
{
161+
STATUS: true/false,
162+
//Masking activity status
163+
DESCRIPTION : "SUCCESS",
164+
//Success or failure description
165+
MASKING_STATUS : true,
166+
//Extracted data from KYC document
167+
MASKING_STATUS: {
168+
COUNT : "10",
169+
//Number of masking done
170+
AADHAAR_NO: "2513 5077 5668",
171+
//Can enable & disable in config.
172+
MASKED_METHOD: "MANUAL/SYSTEM"
173+
//Specify how the masking happened
174+
}
175+
FILE : "<File path of masked image>"
176+
//eg : "/storage/files/Splicer/SP_20240122_183209.jpg"
177+
}
178+
```
179+
180+
---
181+
[© 1996 - 2023 Extrieve Technologies](https://www.extrieve.com/)

0 commit comments

Comments
 (0)