Skip to content

Instantly share code, notes, and snippets.

View alabrashJr's full-sized avatar

Abdurrahman Beyaz alabrashJr

View GitHub Profile
def predict(text):
print("text -> ",text)
text_s=[stemmer.stem(w) for w in text.split()]
print("text stemmed-> ",text_s)
X=vectorizer.transform([text_s])
X_pred=lp_classifier.predict(X).toarray()
return [data.columns[i] for i,x in enumerate(X_pred[0]) if x==1]
text="araçım servise son getirmediğimde düzgün tamir edilmedi memnun değil"

Çoklu Etiket Metin Sınıflandırma

Sınıflandırma Yöntemleri

https://unsplash.com/photos/VISPUxoCwx4

köpek midir? hangi etkit ? hangi etiketler?
Evet/Hayırikili köpek/doğa/çimençok sınıflı köpek,doğa,çimen****çoklu etiket
@alabrashJr
alabrashJr / clean_timesofindia.py
Created September 3, 2019 13:27
this is a script to clean and parse times of india news html files to text files
#this script was written by Cigil and edit by [email protected]
import pandas as pd
from lxml import etree
import re
import os, sys, io, traceback, codecs
from bs4 import BeautifulSoup, Comment
UNESCAPE = True
import html as h
import glob
{
"cells": [
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"import requests \n",
"from bs4 import BeautifulSoup\n",
@alabrashJr
alabrashJr / load_bin_vec
Created March 21, 2019 13:53
load vector of pre-trained embedded word from pre-trained binary file like google_w2v.bin
#fname: the file name of binary file <google_w2v.bin>
#vocab: vocabulary dictionary
function load_bin_vec(fname, vocab)
pc(s)=return convert(Char,s[1])
word_vecs = Dict()
open(fname, "r") do f
@show header = readline(f)
vocab_size, layer1_size = map(pf, split(header))
@show binary_len = sizeof(Float32) * layer1_size