Skip to content

Instantly share code, notes, and snippets.

View AlexMikhalev's full-sized avatar

Dr Alexander Mikhalev AlexMikhalev

View GitHub Profile
@AlexMikhalev
AlexMikhalev / bench.zsh
Last active October 15, 2021 22:03
BERT large QA benchmarks
(venv_the_pattern) ➜ qasearch git:(benchmark) ✗ python3 transformers_plain_bert_qa.py
[101, 2040, 10438, 13434, 6726, 2426, 6001, 1029, 102, 2019, 17727, 2098, 14428, 3372, 2000, 2925, 2913, 1997, 10519, 6726, 1997, 16464, 15245, 2003, 1996, 3768, 1997, 2511, 4725, 2005, 1996, 10788, 1997, 10519, 16464, 12702, 21759, 7088, 19230, 6413, 2005, 4958, 5178, 4328, 10091, 2913, 102]
airborne transmission of respiratory infections is the lack of established methods for the detection of airborne respiratory microorganisms
10.494894326999999 seconds
(venv_the_pattern) ➜ qasearch git:(benchmark) ✗ redis-benchmark -p 30003 -h 127.0.0.1 -n 10 get "bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs viral transmission among adults"
get bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs viral transmission among aduget bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs viral transmission among aduget bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs viral transmission among aduget bertqa{8YG}_PMC302072.xml:{8YG}:10_Who performs vira
@AlexMikhalev
AlexMikhalev / taury_tray.rs
Created June 15, 2021 11:16
Taury Apps tray icon
fn main() {
let show = CustomMenuItem::new("show".to_string(), "Show");
let hide = CustomMenuItem::new("hide".to_string(), "Hide");
let quit = CustomMenuItem::new("quit".to_string(), "Quit");
let tray_menu_items = vec![
SystemTrayMenuItem::Custom(show),
SystemTrayMenuItem::Custom(hide),
SystemTrayMenuItem::Separator,
SystemTrayMenuItem::Custom(quit),
@AlexMikhalev
AlexMikhalev / inexact-search-aho-corasick.ipynb
Created June 1, 2021 19:24 — forked from sujitpal/inexact-search-aho-corasick.ipynb
Code demonstrating building and querying an Aho-Corasick FSM for inexact search
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
cargo install evcxr_jupyter
jupyter --list
jupyter kernelspec list
jupyter kernelspec uninstall rust
evcxr_jupyter --install
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2"\" \n"}' | redis-cli --pipe
python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from rediscluster import RedisCluster
>>> import logging
>>> import logging
>>>
>>> from rediscluster import RedisCluster
>>>
@AlexMikhalev
AlexMikhalev / bug_10_05_2021
Created May 10, 2021 13:31
Potential bug report
1775:M 10 May 2021 13:19:53.513 * <rg> langdetect is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
1775:M 10 May 2021 13:19:53.513 * <rg> six is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
1775:M 10 May 2021 13:20:02.307 * <ai> TORCH backend loaded from /usr/lib/redis/modules/backends/redisai_torch/redisai_torch.so
1775:M 10 May 2021 13:20:09.973 * Reading the remaining AOF tail...
1775:M 10 May 2021 13:20:15.081 * DB loaded from append only file: 30.166 seconds
1775:M 10 May 2021 13:20:15.081 * Ready to accept connections
1775:M 10 May 2021 13:20:15.284 # <rg> Failed on XINFO command : got null reply
@AlexMikhalev
AlexMikhalev / rclusterlogs.txt
Created May 10, 2021 11:33
docker logs -f rgcluster
docker logs -f rgcluster
Starting 30001
Starting 30002
Starting 30003
Starting 30004
Starting 30005
Starting 30006
Starting 30007
Starting 30008
Starting 30009
curl -H "Content-Type: application/json" -X POST -d '{"search":"How does temperature and humidity affect the transmission of 2019-nCoV?"}' https://api.thepattern.digital/qasearch | jq .results
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 31540 100 31456 100 84 1770 4 0:00:21 0:00:17 0:00:04 6940
[
{
"answer": "community transmission",
"sentence": "At the time of this review April 6 2020 the disease termed covID 19 corona virus disease 2019 had become pandemic and spread to more than 203 countries and territories including community transmission in countries like the United States Germany France sPain Japan Singapore South Korea iRan and Italy and a large scale outbreak with more than 600 cases on the cruise ship Diamond Princess",
"sentencekey": "sentence:0020ab317ef923b740c1d3db52083a4e48495f8a:{5M5}:8",
"title": "SARS-CoV-2 Vaccines: Status Report"