Skip to content

Instantly share code, notes, and snippets.

@el-hult
el-hult / cals2tiff.py
Created Jun 13, 2021
Code for converting a CALS raster file to TIFF. Using vanilla Python.
View cals2tiff.py
"""
Python script that takes a folder, and for each CALS Raster file, it converts to a TIFF file.
https://en.wikipedia.org/wiki/CALS_Raster_file_format
file ending ".cal"
It so happens that TIFF can be compressed with Group 4 compression (as in faxes), and that is the compression format of CALS Raster images Type 1.
View tayga_upos_skipgram_300_2_2019_07123c95668befbde6bcaf01dcbe6d5d_config.json
{"embeddings": [{"tensorName": "WebVectors", "tensorShape": [300, 13], "tensorPath": "https://gist.githubusercontent.com/akutuzov/e138139ca401dfde0adcc25f845943bd/raw/1b4c598a3091fb9a1b43c63382f9f7af15eadff1/tayga_upos_skipgram_300_2_2019_07123c95668befbde6bcaf01dcbe6d5d_tensor.tsv", "metadataPath": "https://gist.githubusercontent.com/akutuzov/fa96c60094c27e8d8747b30f76999f82/raw/779cba66787ee4c9b7f8c1d40877d3cfd2d0d809/tayga_upos_skipgram_300_2_2019_07123c95668befbde6bcaf01dcbe6d5d_metadata.tsv"}]}
View tayga_upos_skipgram_300_2_2019_07123c95668befbde6bcaf01dcbe6d5d_metadata.tsv
word Class
Москва PROPN
машина NOUN
Лондон PROPN
транспорт NOUN
клавиатура NOUN
ёжик NOUN
мотоцикл NOUN
компьютер NOUN
быстрый ADJ
View tayga_upos_skipgram_300_2_2019_07123c95668befbde6bcaf01dcbe6d5d_tensor.tsv
-0.12058395892381668 -0.07942052185535431 0.04260742664337158 -0.05039317160844803 -0.07937309890985489 -0.013740834780037403 -0.0056177228689193726 0.003909609746187925 -0.058291953057050705 0.060675282031297684 0.10105962306261063 0.05480136722326279 -0.015148688107728958 0.021084174513816833 -0.10280948132276535 0.03789813071489334 -0.02917475998401642 -0.00836340431123972 0.06638211756944656 -0.03432456776499748 -0.021564504131674767 -0.1164373978972435 0.007209655828773975 0.006395663134753704 -0.07167381793260574 -0.11773037910461426 0.043384406715631485 -0.02404838614165783 -0.07883202284574509 -0.09868486225605011 0.09582486003637314 -0.01979193650186062 0.07252604514360428 0.03067072108387947 0.07432026416063309 0.03242500126361847 -0.0853237435221672 -0.026113517582416534 -0.09141308814287186 0.05005859211087227 0.04528940096497536 -0.07893944531679153 -0.00030599001911468804 0.11452890187501907 0.08976971358060837 -0.022512774914503098 0.01675504818558693 -0.11463489383459091 -0.057304322719573975
View geowac_lemmas_none_fasttextskipgram_300_5_2020_07123c95668befbde6bcaf01dcbe6d5d_config.json
{"embeddings": [{"tensorName": "WebVectors", "tensorShape": [300, 13], "tensorPath": "https://gist.githubusercontent.com/akutuzov/c4b2fa9363c209a40ad4273b8e0b00c6/raw/91ae74ffcafa7f4789dc15b167bd8aaa3f7ea597/geowac_lemmas_none_fasttextskipgram_300_5_2020_07123c95668befbde6bcaf01dcbe6d5d_tensor.tsv", "metadataPath": "https://gist.githubusercontent.com/akutuzov/feab578620de152124b9ab756eeaf9fa/raw/94b32b4db1960245f7416b74ec8afb22cf299289/geowac_lemmas_none_fasttextskipgram_300_5_2020_07123c95668befbde6bcaf01dcbe6d5d_metadata.tsv"}]}
View geowac_lemmas_none_fasttextskipgram_300_5_2020_07123c95668befbde6bcaf01dcbe6d5d_metadata.tsv
word Class
Москва PROPN
машина NOUN
Лондон PROPN
транспорт NOUN
клавиатура NOUN
ёжик NOUN
мотоцикл NOUN
компьютер ADJ
быстрый PROPN
View geowac_lemmas_none_fasttextskipgram_300_5_2020_07123c95668befbde6bcaf01dcbe6d5d_tensor.tsv
0.07801807671785355 0.0471874363720417 -0.02001192420721054 0.074948251247406 0.08333761245012283 0.05358221381902695 0.037999361753463745 0.009313072077929974 -0.000873380689881742 -0.033489834517240524 0.02033878304064274 0.11085070669651031 0.07866300642490387 -0.1250074952840805 0.02639145404100418 0.014191550202667713 -0.03003103658556938 -0.01731872744858265 -0.014357702806591988 -0.10815064609050751 0.017945649102330208 0.10895033925771713 -0.07898362725973129 0.022966589778661728 -0.016641637310385704 0.024969080463051796 0.03342433646321297 -0.027302680537104607 0.011197158135473728 -0.02794315479695797 -0.048318326473236084 -0.046894509345293045 0.006643529050052166 0.08327693492174149 -0.03930695354938507 -0.0753965899348259 -0.00992647185921669 0.0629379078745842 0.0967080369591713 -0.05206604301929474 -0.13009555637836456 -0.024925144389271736 0.05538582429289818 -0.023626765236258507 -0.04017089307308197 0.018145518377423286 -0.02552383951842785 -0.04765887185931206 -0.18341228365898132 0.011608
View news_upos_skipgram_300_5_2019_07123c95668befbde6bcaf01dcbe6d5d_config.json
{"embeddings": [{"tensorName": "WebVectors", "tensorShape": [300, 12], "tensorPath": "https://gist.githubusercontent.com/akutuzov/88c94993de7b02eadac0b07724455eca/raw/7055c6dd1ff2fea2f7640a53198dffb3ac267804/news_upos_skipgram_300_5_2019_07123c95668befbde6bcaf01dcbe6d5d_tensor.tsv", "metadataPath": "https://gist.githubusercontent.com/akutuzov/07ae6000e329cce8b6933de2ca63ae73/raw/4614b6e5b48e3187e208542995695582e412ebc1/news_upos_skipgram_300_5_2019_07123c95668befbde6bcaf01dcbe6d5d_metadata.tsv"}]}
View news_upos_skipgram_300_5_2019_07123c95668befbde6bcaf01dcbe6d5d_metadata.tsv
word Class
Москва PROPN
машина NOUN
Лондон PROPN
транспорт NOUN
клавиатура NOUN
мотоцикл NOUN
компьютер NOUN
быстрый ADJ
Париж PROPN
View news_upos_skipgram_300_5_2019_07123c95668befbde6bcaf01dcbe6d5d_tensor.tsv
0.04834703728556633 0.0572441890835762 0.01850632019340992 -0.1330578327178955 0.0930345430970192 -0.005456890910863876 0.060287948697805405 -0.035984694957733154 0.05430304631590843 -0.0860680490732193 -0.015114826150238514 -0.040642980486154556 -0.04188193753361702 0.03717895969748497 -0.037849366664886475 -0.07576414197683334 -0.03660418838262558 0.0828181579709053 -0.12252148985862732 0.036941707134246826 0.006793325766921043 0.004162408411502838 -0.05419380962848663 0.011800366453826427 0.07376322150230408 -0.014154630713164806 0.04316656291484833 -0.006418826058506966 -0.05661982297897339 -0.03352375701069832 0.11030487716197968 -0.005137900356203318 0.03885567933320999 -0.028912760317325592 -0.06760211288928986 0.0034884593915194273 0.0011195640545338392 0.012787689454853535 -0.09630151093006134 0.0056040408089756966 -0.06802589446306229 0.03152770176529884 -0.1307234764099121 -0.027037987485527992 -0.05038716271519661 0.08469843864440918 -0.08364386856555939 0.1336786448955536 0.0703098326921463 0.004