This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from elasticsearch import Elasticsearch | |
import logging | |
logging.basicConfig(filename='mylog.log',format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) | |
logging.info("Files opened ...") | |
es = Elasticsearch([{'host': '0.0.0.0', 'port': 9200}]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Mar 4 22:52:14 2019 | |
@author: angelosalatino | |
""" | |
import Levenshtein.StringMatcher as ls | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gensim.models import word2vec | |
###################################################### | |
# READ SENTENCES | |
sentences = read_sentences(file="corpus.txt") | |
###################################################### | |
###################################################### | |
#PARAMETHERS | |
model_name='cso-classifier' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from elasticsearch import Elasticsearch | |
import logging | |
import json | |
# import time | |
TIMEOUT_TIME = 1500 | |
# start_time = time.time() | |
logging.basicConfig(filename='mylog.log',format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exporting entire database: | |
mysqldump -u user -p database --opt | gzip > database.sql.gz | |
# Export table | |
mysqldump -uroot --opt --databases DB_NAME --tables TABLE_NAME | gzip > /tmp/TABLE_NAME.export.sql.gz | |
# Importing: | |
gunzip < database.sql.gz | mysql -u user -p database | |
# Credit http://failshell.io/mysql/using-gzip-and-gunzip-with-mysql-to-importexport-backups/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Sat Jan 21 16:23:33 2023 | |
@author: aas358 | |
""" | |
from neo4j import GraphDatabase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Jan 30 11:47:48 2023 | |
@author: aas358 | |
""" | |
import torch | |
from transformers import AutoTokenizer, AutoModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Jan 30 16:31:14 2023 | |
@author: aas358 | |
""" | |
import torch | |
from transformers import AutoTokenizer, AutoModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Oct 16 17:37:07 2023 | |
@author: aas358 | |
""" | |
from __future__ import print_function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# In[1]: | |
from datetime import datetime as dt | |
import shutil | |
import os |