Skip to content

Instantly share code, notes, and snippets.

View deltahedge1's full-sized avatar
๐Ÿ˜

deltahedge1

๐Ÿ˜
View GitHub Profile
@deltahedge1
deltahedge1 / app.py
Last active May 15, 2025 02:51
langchain graph render local mermaid chart
# pip install mermaid-python
# https://pypi.org/project/mermaid-python/
from mermaid import Mermaid
from langraph.graph import StateGraph, START, END
class State(TypedDict):
message: str
def node_1(state):
Function FormatTemplate(template As String, ParamArray values() As Variant) As String
Dim result As String
Dim i As Integer
result = template
For i = LBound(values) To UBound(values)
If InStr(template, "{" & i & ":") > 0 Then
Dim formatSpecifier As String
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deltahedge1
deltahedge1 / understanding-word-vectors.ipynb
Created March 18, 2018 04:06 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deltahedge1
deltahedge1 / curl.md
Created February 8, 2018 15:04 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@deltahedge1
deltahedge1 / example.html
Created December 6, 2017 11:16 — forked from doobeh/example.html
Simple example of using a RadioField in Flask-WTForms to generate a form.
<form method="post">
{{ form.hidden_tag() }}
{{ form.example }}
<input type="submit">
</form>
@deltahedge1
deltahedge1 / pdfTextMiner.py
Created September 13, 2017 11:01 — forked from vinovator/pdfTextMiner.py
A sample code which uses pdfminer module to extract text from pdf files
# pdfTextMiner.py
# Python 2.7.6
# For Python 3.x use pdfminer3k module
# This link has useful information on components of the program
# https://euske.github.io/pdfminer/programming.html
# http://denis.papathanasiou.org/posts/2010.08.04.post.html
''' Important classes to remember
PDFParser - fetches data from pdf file
@deltahedge1
deltahedge1 / README.md
Created September 13, 2017 09:24 — forked from dannguyen/README.md
Using Python 3.x and Google Cloud Vision API to OCR scanned documents to extract structured data

Using Python 3 + Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs