Skip to content

Instantly share code, notes, and snippets.

View johnidm's full-sized avatar

Johni Douglas Marangon johnidm

View GitHub Profile
@johnidm
johnidm / dataset.csv
Created May 26, 2024 12:57
Dataset - Full United State Addresses
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
document
"It was a beautiful summer day, the sun was shining bright and the birds were chirping happily. I was on my way to visit my friend, Tom, who recently moved to a new place. He had been telling me about it for weeks and I was eager to see it in person. He had described it as a charming little house with a big backyard, nestled in the heart of a vibrant and bustling neighborhood.
He had sent me the address a few days ago, ""123 Elm Street, Springfield, Illinois, 62704"". I had punched it into my GPS and off I went, cruising down the highway with my favorite music playing on the radio. I was excited about the prospect of spending the day with Tom, catching up on old times and exploring his new neighborhood.
As I drove, I couldn't help but marvel at the beauty of the surrounding landscape. The lush green fields, the clear blue sky, it was a sight to behold. I could see why Tom had chosen to move here. It was peaceful, serene, and yet full of life and energy. I was sure he was going to love it here.
Aft
@johnidm
johnidm / README.md
Last active April 26, 2024 15:34
SQLite - Use two Database in-memory - Example in SQLAlchemy

Using two SQLite database connection in-memory.

from sqlalchemy import create_engine, MetaData
from sqlalchemy import text
from sqlalchemy.orm import DeclarativeBase

from sqlalchemy import select
from sqlalchemy import insert
from sqlalchemy.orm import Mapped, mapped_column
@johnidm
johnidm / README.md
Created March 31, 2024 11:52
Python Tesseract 5 - Example of Use

A simple approach to using Tesseract with Python using pytesseract.

For more information about Tesseract, see the offical documentation

Install dependecies:

sudo add-apt-repository ppa:alex-p/tesseract-ocr5
sudo apt update
sudo apt install tesseract-ocr-por
@johnidm
johnidm / README.md
Created February 22, 2024 18:00
Sending Emails With Python
import smtplib
from email.mime.text import MIMEText


smtp_server = "smtp.gmail.com"
smtp_port = 587
smtp_username = "noanswer@gmail.br"
smtp_password = "qwer1234"
@johnidm
johnidm / building-a-custom-named-entity-recognition-model-using-spacy-end-2-end-application.ipynb
Created November 21, 2023 18:16
Building a custom Named Entity Recognition model using spaCy - end-2-end application
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johnidm
johnidm / readme.md
Created November 1, 2023 13:30
Generate word cloud from single-column Pandas dataframe

Word cloud is an excellent visualization by which to highlight key words in a text.

In the text classification task, you can use this to see the most common words that appear in the entire text.

We have a pandas dataframe with text collumn our goal is to see the most frequent words.

Install dependencies

pip install wordcloud -q
pip install pandas -q
@johnidm
johnidm / readme.md
Created October 26, 2023 01:01
SoapUI Installation on Linux/Unix - Quick Guide
@johnidm
johnidm / readme.md
Created October 25, 2023 12:48
Run FastAPI in Google Colab
!pip install fastapi pyngrok uvicorn nest-asyncio -q
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from loguru import logger
@johnidm
johnidm / readme.md
Created August 21, 2023 14:57
Integration pyngrok + FastAPI
pip install uvicorn fastapi pyngrok
from pyngrok import ngrok
from fastapi import FastAPI
import uvicorn

import os
@johnidm
johnidm / readme.md
Created July 31, 2023 16:22
An optimized approach to document summarization with OpenAI - Chat GPT

In this easy-to-follow gist you can find an approach to use OpenAI Chat GPT to summarize documents.

Dependencies

pip -q install langchain openai tiktoken

Source Code

import urllib.request