MetaMap is a tool developed by the National Library of Medicine for analyzing biomedical texts. Follow these steps to install and set up MetaMap on a Linux system.
- Java Installation:
- Ensure Java is installed:
import cv2 | |
import numpy as np | |
import sys | |
img = cv2.imread('1.jpg') | |
print(sys.getsizeof(img)) | |
img_encoded = cv2.imencode('.jpg', img)[1] | |
print(sys.getsizeof(img_encoded)) | |
img_bytes = img_encoded.tobytes() # bytes class |
# author: github.com/zabir-nabil | |
import librosa | |
from pydub import AudioSegment | |
import pydub | |
import os | |
def segment_aud_eq(audio_segment, k): | |
# k denotes, seconds * 1000 | |
a_segs = [audio_segment[i*k:min((i+1)*k, len(audio_segment)-1)] for i in range(len(audio_segment)//k)] |
from selenium import webdriver | |
from bs4 import BeautifulSoup | |
from selenium.webdriver.chrome.options import Options | |
chrome_options = Options() | |
chrome_options.add_argument("--headless") | |
chrome_options.add_argument('--no-sandbox') | |
driver = webdriver.Chrome('/usr/bin/chromedriver', options=chrome_options) | |
ips = open("ip.txt", "r") | |
keywords = ["login", "denied", "username", "password", "Apache2"] |
Deploying free email server, web hosting panel with CyberPanel on subdomain | |
Summary: | |
Let's say we have a domain "test.com". We want to install an email server for our domain, we want it free. | |
First make sure the droplet has no app running on port 80, 443 (or nginx, apache websites). | |
Install CyberPanel, | |
on DO, https://marketplace.digitalocean.com/apps/cyberpanel | |
sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh) |
Location,Country,Country_Code_Alpha_2,Lat,Long | |
A Cañiza,Spain,ES,42.216671,-8.26667 | |
A Coruña,Spain,ES,43.371349,-8.396 | |
A Coruña,Spain,ES,43.371262,-8.4188 | |
A Dos Cunhados,Portugal,PT,39.156479,-9.32206 | |
A Dos Francos,Portugal,PT,39.314468,-9.04547 | |
A Estrada,Spain,ES,42.683331,-8.48333 | |
A Guarda,Spain,ES,41.90131,-8.87423 | |
A Guarda,Spain,ES,41.90403,-8.87225 | |
A Mezquita,Spain,ES,42.013142,-7.04675 |
from model_ecapatdnn import ECAPAModel | |
import soundfile as sf | |
import torch | |
# load your pytorch model (+ weights) here | |
model_1 = ECAPAModel.ECAPAModel(lr = 0.001, lr_decay = 0.97, C = 1024, n_class = 18505, m = 0.2, s = 30, test_step = 3, gpu = -1) | |
model_1.load_parameters("/ecapatdnn/exps/finetuned/model/model_0028.model") | |
model = model_1.speaker_encoder # module with forward implemented | |
# if your forward function contains any arguments other than the input tensors, make sure to add default values |
# python triton client | |
import numpy as np | |
import sys | |
import tritonclient.grpc as grpcclient | |
try: | |
keepalive_options = grpcclient.KeepAliveOptions( |
do-release-upgrade |
# Speaker Experiments and MLflow | |
Speaker experiments take relatively long time to finish. For tracking the experiment progress, we can utilize MLflow. | |
### What is MLflow? | |
MLflow is a platform to streamline machine learning development, including tracking experiments, packaging code into reproducible runs, and sharing and deploying models. MLflow offers a set of lightweight APIs that can be used with any existing machine learning application or library (TensorFlow, PyTorch, XGBoost, etc), wherever you currently run ML code (e.g. in notebooks, standalone applications or the cloud). MLflow's current components are: | |
* MLflow Tracking: An API to log parameters, code, and results in machine learning experiments and compare them using an interactive UI. | |
* MLflow Projects: A code packaging format for reproducible runs using Conda and Docker, so you can share your ML code with others. |