This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
url = "https://api.explosion.ai/displacy/ent/" | |
HEADER = {'Content-type': 'text/plain'} | |
while True: | |
data = {'text':raw_input(), 'model':'en'} | |
data = json.dumps(data) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
, , | |
/ \/ \ | |
(/ //_ \_ | |
.-._ \|| . \ | |
\ '-._ _,:__.-"/---\_ \ | |
______/___ '. .--------------------'~-'--.)__( , )\ \ | |
`'--.___ _\ / | Here ,' \)|\ `\| | |
/_.-' _\ \ _:,_ Be Dragons " || ( | |
.'__ _.' \'-/,`-~` |/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageDraw, ImageFont | |
import matplotlib.pyplot as plt | |
import numpy as np | |
image = Image.new('RGB', (700, 40)) | |
# Make sure the location to the font is correct | |
draw.text((40,5), 'നമ്മുടെ മലയാളം അടിപൊളിയായി ഇമേജിൽ വരുന്നു', font=ImageFont.truetype('./Manjari-Bold.ttf', 25)) | |
plt.imshow(np.asarray(image)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
testing celery progress reporting/polling | |
* start server | |
python tempserver.py | |
* start worker | |
celery -A tempserver.celery worker -c 1 --loglevel=DEBUG | |
* browse to localhost:5000/ | |
''' | |
from flask import Flask, request, render_template_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Export entire database | |
CALL apoc.export.graphml.all('/tmp/complete-graph.graphml', {useTypes:true, storeNodeIds:false}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import from GraphML | |
CALL apoc.import.graphml('/tmp/complete-graph.graphml', {batchSize: 10000, storeNodeIds: false}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $1 is the first argument | |
# remove result.txt | |
#rm output/result.txt | |
fname=`echo "$1" | awk -F "/" '{print $(NF)}'` | |
# convert the pdf to a group of tiffs | |
if [ ! -e extracted_tz_parliament/$fname.txt ]; | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": "how much revenue did we generate in the last quarter from XYZ Corp?", | |
"response": { ... } | |
} |
OlderNewer