Sign inSign up

blockaero/extract-fields

By blockaero

Updated about 6 years ago

Image
0

1.0K

blockaero/extract-fields repository overview

Important Update Instructions

Dockerfile for this microservice should match the requirements of your trained model.

For example, as of 10 December 2018, we used Prodigy v1.6.1

  1. Refer to Prodigy Changelog https://prodi.gy/docs/changelog
  2. We see that the v1.6.1 is optimized for spacy==2.0.16, so make sure the Dockerfile has spacy matching that version number.
  3. Also, you can see the python version optimized for this is 3.7. Review https://conda.io/miniconda.html and make sure you are good there.

To build and test this microservice alone


docker build --build-=https://github.com/openfaas-incubator/of-watchdog/releases/download/0.4.5/of-watchdog -t blockaero/extract-fields:local ocrpipeline/extract-fields

Making changes and redeploying service

./deploy.sh DEV extract-fields

Testing endpoint without initiating the entire pipeline

//add the following header if you dont want the chaining action of the pipeline.
-H "strategy:{}"

DEV

//this will work only in dev.
//the reason is, async-function is exposed only in DEV.
//in production the orchestration happens via the orchestration overlay network.
arc="$(cat sample_arc.txt)"
//if you want to do only upload - without doing any further steps
curl -v  http://localhost/function/extract-fields \
       -d "$(echo "$arc")"  \
       -H "page:1" \
       -H "classification:"[\"ARC\"]""
       -H "X-Callback-Url: http://webhook/" \
       -H "X-Api-Key:$api_key"

Expected Response

{
  "action": "ner",
  "endpoint": "extract-fields",
  "input": "AUTHORIZED RELEASE CERTIFICATE\nFAA Form 8130-3 AIRWORTHINESS APPROVAL TAG\nI\n\nInvoice Number\n\nPRATT & WHITNEY\n\nGEORGIA DISTR. CENTER\n\n628 HEBRON AVE\" SUITE 400\n\n3781 SOUTHSIDE INDUSTRIAL CT SE\n\nFAA APPROVAL HOLDER\n\nGLASTONBURY, CT 06033\n\nATLANT A, GA 30354-3218 US\n\nPRODUCTION CERTIFICATE NUMBER 114NE\n\nIAE INTERNATIONAL AERO ENGINES AG\n\nUSA\n\n87105669\nI\n\n13. Remarks: Page 6 of\nEXPORT\n14. Certifies the items\n\n[]I\n\no\n\nCONTD\n\n2A3838\n\nBLADE-TURBINE\n\ntl\n\nI\n\nPKLBL80276\nPKLBL80382\nPKLBL80394\nPKLBL80592\nPKLBLW2532\nPKLBLW2548\nPKLBLW2656\nPKLBLW2667\nPKLBLW2730\nPKLBLW2788\n\n7\nDIRECT SHIPMENT AUTHORIZATION\nabove were manufactured in conformity to:\n\nApproved design data and are in a condition tor safe operation\nNon-approved design data specified in BlocK 13.\n\n16. Approval Authorization No:\n\nODA400098NE\n, Date(mldlyJ:\n\nIt is important to understand that the existence of this Document alone does not automatically constitute authority to install the part/component/assembly.\n'vVhere the user/installer performs work in accordance with the national regulations of an airworthiness authority different than the airworthiness authority of the country specified in Block\n\n1, it is essential that the userlinstaller ensures that his/her airworthiness authority accepts parts/components/assemblies from the airworthiness authority of the country specified in Block\n1.\nStatements in Block 14 and 19 do not constitute installation certification. In all cases, aircraft maintenance record must contain an installation certification issued in accordance with the\n: national regulations by the userllnstaller b~_fo_r_e_t_hec-c-a_ir_cr_a...,ft_m_a-,-y_b_e_f_lo_w_n_._ _ _---.,,...-_ _..\".,_ _...,-:_ _ _ _-..,._ _ _-:-_ _ _ _ _ _:-::_ _~__--_:___:__:_~_=_---\n\nFAA Form 8130-3(6-01)\n\n'Installer must cross check eligibility with applicable technical data\n\nNSN: 0052-00-012-9005\n\nAUTHORIZED RELEASE CERTIFICATE\n\nNumber\n\n1387105669\n\nFAA Form 8130-3 AIRWORTHINESS APPROVAL TAG\n!\n\nIAE INTERNATIONAL AERO ENGINES AG\n\nPRATT & WHITNEY\n\nGEORGIA DISTR. CENTER\n\n628 HEBRON AVE\" SUITE 400\n\n3781 SOUTHSIDE INDUSTRIAL CT SE\n\nFAA APPROVAL HOLDER\n\nGLASTONBURY, CT 05033\n\nATLANTA, GA 30354:3218 US\n\nPRODUCTION CERTIFICATE NUMBER 114NE\n\nUSA\n\n5.Work\nInvoice\n\n(Contractl\n\nmber\n\n87105669\n\ni i ii\n\nBLADE-TURBINE\n\n13. Remarks: Page 7 of\nEXPORT\n\n2A3838\n\nCONTD\n\nPKLBLW2796\nPKLBLW2878\nPKLBLW2881\nPKLBLW2969\nPKLBLW2977\n\n7\nDIRECT SHIPMENT AUTHORIZATION\n\n14. Certifies the items identified above were manufactured in conformity to:\n\n[]1\n\nApproved design data and are in a condition for safe operation\n\nD\n\nNon-approved design data specified in Block 13.\n\nIt Is important to understand that the existence of this Document alone does not automatically constitute authority to install the part/component/assembly,\nWhere the user/installer performs work in accordance with the national regulations of an airworthiness authority different than the airworthiness authority of the country specified in Block\n1, it is essentlat that tile userlinstaller ensures that his/her airworthiness authority accepts parts/components/assemblies from the airworthiness authOrity of the country speclfJed in Block\n1.\nStatements in Block 14 and 19 do not constitute fnstallation certification. In all cases, aircraft maintenance record must contain an installation certification issued in accordance with the\nnational regulations by the user/installer before the aircraft may be flown.\n\nFAA Form 8130-3i6- 1)\n\nnstaller must cross check eligibility with applicable technical data\n\n\f",
  "next_action": "",
  "next_action_response": "",
  "page": 1,
  "result": {
    "data": [{
      "f_score": 90,
      "field": "PARTNO",
      "model_used": "partno_etihad1_standalone_90",
      "status": 200,
      "text": ["2A3838"]
    }, {
      "f_score": 87,
      "field": "DESCRIPTION",
      "model_used": "description_etihad1_standalone_87",
      "status": 200,
      "text": []
    }, {
      "f_score": 96,
      "field": "FORMID",
      "model_used": "formid_ba1_standalone_96",
      "status": 200,
      "text": ["FAA Form 8130-3", "FAA Form 8130-3"]
    }, {
      "f_score": 73,
      "field": "FORMTRACKINGNUMBER",
      "model_used": "formtrackingnumber_ba1_standalone_73",
      "status": 200,
      "text": []
    }, {
      "f_score": 86,
      "field": "WORKORDER",
      "model_used": "workorder_etihad1_standalone_86",
      "status": 200,
      "text": []
    }, {
      "f_score": 83,
      "field": "APPROVENAA",
      "model_used": "approvenaa_ba1_standalone_83",
      "status": 200,
      "text": []
    }, {
      "f_score": 80,
      "field": "APPROVALNO",
      "model_used": "approvalno_ba1_standalone_80",
      "status": 200,
      "text": []
    }, {
      "f_score": 87,
      "field": "SERIALNO",
      "model_used": "serialno_etihad1_standalone_87",
      "status": 200,
      "text": []
    }, {
      "f_score": 73,
      "field": "ORG",
      "model_used": "org_etihad1_standalone_73",
      "status": 200,
      "text": ["PRATT & WHITNEY"]
    }, {
      "f_score": 61,
      "field": "ADDRESS",
      "model_used": "address_etihad1_standalone_61",
      "status": 200,
      "text": ["IAE INTERNATIONAL AERO ENGINES AGPRATT & WHITNEYGEORGIA DISTR."]
    }, {
      "f_score": 98,
      "field": "STATUS",
      "model_used": "status_ba1_standalone_98",
      "status": 200,
      "text": []
    }, {
      "f_score": 97,
      "field": "DATE",
      "model_used": "date_etihad1_standalone_97",
      "status": 200,
      "text": []
    }, {
      "f_score": 74,
      "field": "REMARKS",
      "model_used": "remarks_etihad1_standalone_74",
      "status": 200,
      "text": ["Page 6 ofEXPORT", "Page 7 ofEXPORT2A3838CONTD"],
      "time_cycle_data": {}
    }, {
      "f_score": 85,
      "field": "PERSON",
      "model_used": "person_ba1_standalone_85",
      "status": 200,
      "text": ["BLADE"]
    }, {
      "f_score": 0,
      "field": "DATE",
      "model_used": "date_spacyen",
      "status": 200,
      "text": ["30354-3218", "1387105669"]
    }]
  },
  "status": 200,
  "total_time_taken": "2.2468101978302"
}

Tag summary

Content type

Image

Digest

Size

1.2 GB

Last updated

about 6 years ago

docker pull blockaero/extract-fields:a16559384be15ed4c5a33601187fb549df80e88b