Skip to content

Instantly share code, notes, and snippets.

View emrepun's full-sized avatar

emrepun emrepun

  • Munich
View GitHub Profile
@emrepun
emrepun / german-driving-license.md
Created February 19, 2022 21:52 — forked from blessanm86/german-driving-license.md
Quick Ref Notes for German Driving License Test

What are the consequences for a person driving a motor vehicle under the influence of drugs (e.g. hashish, heroin, cocaine)?

[x] Confiscation of driving licence or driving ban
[x] Compulsory medical/psychological examination
[x] Fine and/or imprisonment

In which instances do you have to approach a pedestrian crossing with particular care?

[x] If pedestrians want to cross the road

[x] If the view of the pedestrian crossing is restricted

@emrepun
emrepun / jsonDataSample.swift
Created January 15, 2021 10:31
jsonDataSample
//
// JSONData.swift
// CompareCoreDataFileManager
//
// Created by Emre Havan on 09.10.20.
// Copyright © 2020 Emre Havan. All rights reserved.
//
import Foundation
@emrepun
emrepun / EnumJsonParsing.swift
Created February 3, 2020 20:31
Parse json item array (consists of different items) with enums & associated values
import Foundation
struct GeometricShapes: Decodable {
let items: [Object]
}
enum Object: Decodable {
case square(Square)
case sphere(Sphere)
case cylinder(Cylinder)
import numpy as np
import pandas as pd
import json
import pickle
import re
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
class ReviewClassifierService:
@emrepun
emrepun / recommender_engine_version_4.py
Created December 8, 2019 23:24
merged_engine_3.py
# Version-4
def get_recommendations_include_rating_count_threshold_positive_negative_reviews(keywords):
df = pd.read_csv('city_data_cleared.csv')
score_dict = {}
for index, row in df.iterrows():
cs_score = CosineSimilarity.cosine_similarity_of(row['description'], keywords)
rating = row['rating']
@emrepun
emrepun / recommender_engine_version3_method.py
Created December 8, 2019 23:21
merged_recommender_engine_2.py
# Version-3
def get_recommendations_include_rating_count_threshold(keywords):
df = pd.read_csv('city_data_cleared.csv')
score_dict = {}
for index, row in df.iterrows():
cs_score = CosineSimilarity.cosine_similarity_of(row['description'], keywords)
rating = row['rating']
@emrepun
emrepun / recommender_engine_version2_method.py
Last active December 8, 2019 23:29
merged_engine_1.py
import numpy as np
import pandas as pd
from cosine_similarity import CosineSimilarity
from rating_extractor import RatingExtractor
import operator
import json
class RecommenderEngine:
def __init__(self):
print("engine initialized")
@emrepun
emrepun / request.py
Created December 4, 2019 23:30
engine_gist_11.py
from recommender_engine import RecommenderEngine
import json
culture_keywords = "history historical art architecture city culture"
beach_n_sun_keywords = "beach beaches park nature holiday sea seaside sand sunshine sun sunny"
nightlife_keywords = "nightclub nightclubs nightlife bar bars pub pubs party beer"
def get_recommendations(keywords):
result = RecommenderEngine.get_recommendations(keywords)
return result
@emrepun
emrepun / recommender_engine.py
Created December 4, 2019 23:28
engine_gist_10.py
import numpy as np
import pandas as pd
from cosine_similarity import CosineSimilarity
from rating_extractor import RatingExtractor
import operator
import json
class RecommenderEngine:
def __init__(self):
print("engine initialized")
@emrepun
emrepun / rating_extractor.py
Created December 4, 2019 23:27
engine_gist_9.py
from math import e
class RatingExtractor:
def __init__(self):
print("rating initialized")
# Version-4
#Returns overall rating score
#Parameters: