Skip to main content

Filter OCR text from prescriptions to extract drug-related texts

Project description

RxBagExtractor

RxBagExtractor 약봉투 사진을 OCR로 읽은 뒤, 해당 텍스트에서 약물명 관련 텍스트를 추출하는 파이썬 라이브러리입니다. 한글로 작성된 처방전 텍스트 처리에 최적화되어 있습니다.

Features

  • 텍스트 필터링: OCR로 읽은 텍스트에서 사용자가 지정한 정규 표현식에 따라 불필요한 텍스트를 제거합니다.
  • 약물 이름 추출: 주어진 텍스트에서 약물 이름만을 추출하는 기능을 제공합니다.

Installation

pip install RxBagExtractor

Usage

Required Parameter

  • ocr_text: OCR로 읽은 후 얻은 텍스트로, 각 줄이 엔터로 구분된 긴 문자열입니다.

Optional Parameters

  • stopwords_customize: 기본 불용어 리스트 외에 추가적으로 필터링하고 싶은 단어들을 문자열 리스트로 입력할 수 있습니다.
  • patterns_exact_customize: OCR 텍스트의 각 줄에서 정확히 매치되어야 할 정규 표현식을 포함하는 리스트. 각 항목은 re.compile(r"정규표현식") 형식으로 입력됩니다.
  • patterns_include_customize: OCR 텍스트의 각 줄에 이 정규표현식이 포함되어 있으면 해당 줄을 삭제합니다. re.compile(r"정규표현식") 형식으로 입력됩니다.

Example

from RxBagExtractor import extractor

# 약봉투 사진에 대한 OCR 결과 텍스트
ocr_text = "여기에 OCR로 읽은 텍스트 입력"

# Parameter 정의
stopwords_customize = ['유아용', '방문시']
patterns_exact_customize = [re.compile(r"^\d{4}-\d{2}-\d{2}$")]
patterns_include_customize = [re.compile(r"^\d+-\d+-\d+$")]

# 함수 실행
result = extractor(ocr_text, stopwords_customize, patterns_exact_customize, patterns_include_customize)
print(result)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RxBagExtractor-0.1.5.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

RxBagExtractor-0.1.5-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file RxBagExtractor-0.1.5.tar.gz.

File metadata

  • Download URL: RxBagExtractor-0.1.5.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for RxBagExtractor-0.1.5.tar.gz
Algorithm Hash digest
SHA256 0dcc05906b7a5f8cd33b556fcc95f8157a8c300289afe3aa2612362f252c9d2b
MD5 3ac95f2a2eac616ab00a46267701f5ab
BLAKE2b-256 5d54adc7d366af40f464432467a424e15f00e8923efbdf4b50aaf88d28cb0a98

See more details on using hashes here.

File details

Details for the file RxBagExtractor-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: RxBagExtractor-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for RxBagExtractor-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 851f4ddae73656cf40651e7c6aef316952faa91b255e5b838a7ce7e7fd09b26e
MD5 7b6cbeb318856e4dd614b749afa4591c
BLAKE2b-256 6d0813c73ee01066f5c5c9a917a3fbc74fda1f47f82163e0963f8f2c91d52154

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page