this program is to provide several basic service with django
- chinese sentiment(using snownlp)
- signature for image(using imagehash)
- image's color histogram
- image ocr service
- text speech act classification
pip -r requirements.txt cd olnlp python manage.py runserver 0.0.0.0:8000
##API
chinese sentiment:
POST -- http://ip:port/snow/ {'text':text}
image signature:
POST -- http://ip:port/image/ {'image':url}
image histgram:
POST -- http://ip:port/hist/ {'image':url}
ocr(both english and chinese):
POST -- http://ip:port/ocr/ {'image':url}
For GET method, there is so much limitation about the text such as symbols. We can simplely deactive csrf. Otherwise we need to use other framework.
- Grayscale the image
- shrink the image to a common size (9*8)
- compare adjacent pixels if bigger
- get boolean matrix and change it to a hash signature.
- dependency for ocr service
- install command: sudo apt-get install tesseract-ocr && sudo apt-get install tesseract-ocr-chi-sim (model and data version should be matched.)