Skip to content

Instantly share code, notes, and snippets.

Avatar

Finn Årup Nielsen fnielsen

View GitHub Profile
View Nielsen2018Visual_analyze.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Nielsen2020Homographs_wordnet.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fnielsen
fnielsen / Combining embedding methods for a word intrusion task.ipynb
Last active Mar 22, 2019
Jupyter notebook for a small study on embedding methods on a Danish word intrusion task
View Combining embedding methods for a word intrusion task.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Nielsen2017Linking_camera.py
"""
Usage:
Nielsen2017Linking_camera.py
Notes
-----
This script demonstrates the use of Wikidata together with
ImageNet-based deep learning classifiers. It relates to the manuscript
"Linking ImageNet WordNet Synsets with Wikidata" from 2018.
@fnielsen
fnielsen / imagenet_label_to_wordnet_synset.txt
Created Aug 23, 2017
ImageNet label to wordnet synset identifier
View imagenet_label_to_wordnet_synset.txt
{0: {'id': '01440764-n',
'label': 'tench, Tinca tinca',
'uri': 'http://wordnet-rdf.princeton.edu/wn30/01440764-n'},
1: {'id': '01443537-n',
'label': 'goldfish, Carassius auratus',
'uri': 'http://wordnet-rdf.princeton.edu/wn30/01443537-n'},
2: {'id': '01484850-n',
'label': 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
'uri': 'http://wordnet-rdf.princeton.edu/wn30/01484850-n'},
3: {'id': '01491361-n',
@fnielsen
fnielsen / Federated queries with Virtuoso.py
Created May 10, 2017
Federated queries with Virtuoso
View Federated queries with Virtuoso.py
"""Federated queries with Virtuoso."""
import sys
from SPARQLWrapper import SPARQLWrapper, JSON
QUERY_WIKIDATA = """
PREFIX wd: <http://www.wikidata.org/entity/>
@fnielsen
fnielsen / mixedindexing.py
Last active Nov 16, 2019
Mixed indexing with integer index in Pandas DataFrame
View mixedindexing.py
import pandas as pd
df = pd.DataFrame([[1, 2, 's'], [3, 4, 't'], [4, 5, 'u']],
index=[-1, 0, 1], columns=['a', 'b', 'c'])
>>> df.a # Correct type
-1 1
0 3
1 4
Name: a, dtype: int64
@fnielsen
fnielsen / Nielsen2015Python_metrojet9268.ipynb
Created Nov 3, 2015
Plotting of Metrojet 9268 Extended Mode-S Data Decoded
View Nielsen2015Python_metrojet9268.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View fftprimeproblem.py
# https://github.com/fnielsen/everything
from everything import *
import pyfftw.interfaces.scipy_fftpack
def is_prime(n):
"""https://stackoverflow.com/questions/18833759/"""
if n % 2 == 0 and n > 2:
return False
@fnielsen
fnielsen / gist:3efb548dc4958206331b
Created May 4, 2015
Danish Wikipedia page view statistics
View gist:3efb548dc4958206331b
wget https://dumps.wikimedia.org/other/pagecounts-all-sites/2015/2015-05/pagecounts-20150501-000000.gz
gzip -cd pagecounts-20150501-000000.gz | grep "^da " | perl -anle "print @F[2] . ' ' . @F[1] unless @F[1] =~ /(Bruger|Brugerdiskussion|da|Diskussion|Fil|Hj\%C3\%A6lp|Hj\%C3\%A6lp-diskussion|Kategori|Kategoridiskussion|MediaWiki|Portal|Skabelon|Skabelondiskussion|Speciel|Wikipedia|Wikipedia-diskussion):/i" | sort -nr | less
You can’t perform that action at this time.