Skip to content

Instantly share code, notes, and snippets.

View Hilal-Urun's full-sized avatar

Hilal ÜRÜN Hilal-Urun

View GitHub Profile
# pip install install mysql-connector-python
import mysql.connector
from mysql.connector import Error
connection = mysql.connector.connect(host='db-mysql-fra1-08423-do-user-8476727-0.b.db.ondigitalocean.com',
database='defaultdb',
port='25060',
user='doadmin',
password='AVNS_gVLHcpWOtMuGqTO')
if connection.is_connected():
@Hilal-Urun
Hilal-Urun / similarity.py
Created May 9, 2022 15:14
senetence-transformers
#!pip install sentence-transformers==2.2.0
from sentence_transformers import SentenceTransformer, util
model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2")
#fbInterests func takes 2 arrays which are contain interests of google and fb and returs a similarty dict with accuracy scores
def fbInterests(google, fb):
sims={}
for g in google:
for f in fb :
g_embedding = model.encode(g)
f_embedding = model.encode(f)
@Hilal-Urun
Hilal-Urun / pmc_fulltext.py
Created March 28, 2022 15:12
getting full text data from pmc
from Bio import Entrez
from html_parser import strip_tags
Entrez.email = 'your.email@example.com'
pmc_id = "Write pmc id here" # papers pmc id or you can add also ids
fetch = Entrez.efetch(db='pmc',
resetmode='xml',
id=pmc_id,
rettype='full')
data=(fetch.read()).decode("UTF-8")
@Hilal-Urun
Hilal-Urun / flask.py
Last active February 4, 2022 21:00
default_flask
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'