Skip to content

Instantly share code, notes, and snippets.

View ufukhurriyetoglu's full-sized avatar
🎯
Focusing

ufukhurriyet ufukhurriyetoglu

🎯
Focusing
View GitHub Profile
@ufukhurriyetoglu
ufukhurriyetoglu / dateparser_lark.py
Created August 21, 2019 14:34 — forked from ryukinix/dateparser_lark.py
An EBNF grammar based in the Lark Parser designed to parse multivariate date formats. (PT_BR)
#!/usr/bin/env python3
# coding: utf-8
#
# Copyright © Neoway Business Solutions
#
# @project: Diário Oficial
# @author: Manoel Vilela
# @email: [email protected]
#
@ufukhurriyetoglu
ufukhurriyetoglu / gist:21cb7010077edbf00a1372e9706acd48
Created June 19, 2019 20:59 — forked from ttezel/gist:4138642
Natural Language Processing Notes

#A Collection of NLP notes

##N-grams

###Calculating unigram probabilities:

P( wi ) = count ( wi ) ) / count ( total number of words )

In english..

@ufukhurriyetoglu
ufukhurriyetoglu / chatbot.py
Created April 17, 2019 20:41 — forked from navid-w/chatbot.py
chatbot (ai by mathieu rodic, gui by me)
#updated 5/7/17
import tkinter as tk
import re
import sqlite3
from collections import Counter
from string import punctuation
from math import sqrt
from time import sleep ##for delay realism
global B
@ufukhurriyetoglu
ufukhurriyetoglu / bobp-python.md
Created March 17, 2019 00:17 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@ufukhurriyetoglu
ufukhurriyetoglu / Recipes - Entity Extraction.ipynb
Created May 8, 2018 08:09 — forked from psychemedia/Recipes - Entity Extraction.ipynb
Examples of tagging and fuzzy matchings items in txt docs using python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ufukhurriyetoglu
ufukhurriyetoglu / autocorrrect.py
Created February 27, 2018 08:12 — forked from bgreenlee/autocorrrect.py
Simple ngram autocorrect #python #algorithms
import os.path
import collections
from operator import itemgetter
WORDFILE = '/usr/share/dict/words'
class Autocorrect(object):
"""
Very simplistic implementation of autocorrect using ngrams.
"""
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@ufukhurriyetoglu
ufukhurriyetoglu / timeseries_cnn.py
Created October 17, 2017 09:33 — forked from jkleint/timeseries_cnn.py
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential