My Audio setup

In this article I will give a little big of background to my music system and why I use the certain components.

First, the speakers: I use some speakers which enable me to give input via USB. This has the great advantage I can use whatever computer I want to push the music signals to the speakers. (side note: I am using some speakers by Nubert, which also have digital and analogue input for other sources) My music comes directly from a raspberry pi with Mopidy and Raspotify. These two tools allow me to play basically all the music I have on hard disk or to stream it from the internet. I also programmed some small software, that shows the title and artist on a small display and I added some buttons, so I can pause the track and turn the pi off.

The connection using USB is actually very great since it reduces the amount of cables a lot. Before this, I used an external sound card, which also worked well, but needed more space. Another option would be HiFiBerry, but I do not have any experience about sound quality.

Why did I use this setup and not buy directly speakers like from Sonos or other systems? I like to keep my system as easy to repair and change as possible. My speakers will probably last longer than my raspberry, so I want to able to change the way music comes to the speakers. Also, I want to be able to change my streaming service. All this might or might not be possible using out-of-the-box systems.

And finally, the raspberry pi and mopidy are open systems, where you can add your own code in order to improve your setup.

Digital Humanities at Hochschule Darmstadt

In summer semester me and Professor Rittberger will be giving a class about digital humanities at Hochschule Darmstadt in the major information science. Here is our syllabus, I will try to upload slides as well (but in German).

We want to give a broad overview about what Digital Humanities mean. There are also other classes dealing with text-mining, so we do not focus so much on it (there are four lessons about it, though)

  1. Introduction to Digital Humanities: What are DH, what can we do with digital methods
  2. Research methods: Qualitative and quantiative methods in social sciences, hermeneutics, virtual research environments
  3. Law, ethics: Basic understanding what law means and what problems it can cause. This leads to data management and open data
  4. XML: Basics about XML, why DTDs are useful, standards like TEI (2 sessions), XML regarding ontologies
  5. Editions and digitalization: What are editions, how can we create them digitally? How do we digitize content?
  6. Basics of Text analysis: Distant Reading, Google n-grams, how new methods in text analysis can help in research
  7. Named-Entity-Recognition: We chose this problem of NLP to give an overview of what can be done using new technology and also to compare approaches from computer science like machine learning with approaches from information science and semantic web
  8. Topic Modelling: Basic introdution and practial usage with R
  9. Network analysis: Basics of network analysis and how to use it for instance for plays. Tool: Gephi
  10. Geoinformation: How can we code geographical data, how can we use it in DH?
  11. 3D-Modelling: What new approaches are there using 3D-Modelling, how can we use it in DH? Tool: Blender

 

Semantic MediaWiki Conference (SMWCon) Fall 2017

Last week there was the SMWCon, the european conference on Semantic MediaWiki. It was held in Rotterdam. Our venue was directly in the Zoo in the middle of the aquarium. So we could watch sharks and turtles during the talks!!

But there were also very interesting talks. The information to most of the talks you can find here. I will describe some of the talks that were interesting for me because they dealt with stuff I might use in the future.

The keynote on the first day dealt with firefighters and their problem with information overload. Also fire fighters have the problem: you have a lot of information, it is hard to find it, it is in different formats (GPS, Information Systems, paper copies). But fire fighters do only have limited time until they reach the burning building and have to act then and cannot loose even more time reading documentation. So they need the right information in time, which is quite difficult.

He also stressed that machine learning and reasoning over knowledge are nice, but you sometimes especially as fire fighters you have completely new cases, but actually the world and technology changes, so you still will face new obstacles. An example could be the case of a burning of a car with and electric engine.

Karsten then introduced the new stuff they develop for SMW 3.0, which will be a major release. He also stressed that the software needs better documentation, something I also encountered when I tried to introduce new people to SMW. But this is a problem in lots of Open Source projects: People like to code, but not to write documentation. This also shows that for Open Source projects you do not only need coders ;))

Tobias introduced annotation tools for images, text and videos. This was developed as part of our projects and we would be excited to see use-cases and of course feedback to the extensions.

The keynote on Friday was about a project called slidewiki. This is basically a wiki that allows you to create and re-use presentation slides, annotate them, link them to topics and so on. It is really cool because other projects like Slideshare do note allow this and also do not allow forking of that.

The second talk was by Cindy Cicalese, who works for Wikimedia Foundation. She introduced that she will be advocating the 3rd party developers more in the project management of MediaWiki. You can go to their site to see stuff they want to do. In short:

  • They want to do content revision, so making more than one slot on a wiki page, a functionality that right now you can only get with SMW and PageForms
  • They also tackle the installation, updating and maintaing of wikis. This is actually a very important topic that basically everyone in the community faces. We normally do not have one wiki, we have a lot more. And updating every single one and also setting up is cumbersome.
  • They want to introduce a roadmap to make the development of MediaWiki more predictable. This would also help 3rd partys because we can tell our customers if a certain feature will be implemented soon or not

After that, Alexander Gesinn introduced a pre-configured virtual machine. Actually this might be nice for people who only want to try out SMW, with productive usage you still face the problems with maintenance. He named three things every enterprise-wiki has to have (and I agree with him):

  • Semantics (SMW + PageForms)
  • VisualEditor to not torture users with Wikisyntax
  • a responsible skin to have nice-looking wiki on mobile devices

Remco hat on thursday also a talk about a similiar topic, he called it wiki product lines. A product line is similar to the industry where you have different TVs that are all basically the same, only the screen size changes with the different products. He explained from a little bit more theoretical standpoint where he sees potential. To me this looks like a problem that will be tailored and we might have some (hopefully) completely free and documented solutions for this.

End the end of the day there was also a workshop organized by my colleague Lia and me. We said to set up a page on the SMW-Wiki where we collect projects and how we might use the stuff in the future.

Overall, it was a nice conference and I got to know many nice people. Also thanks to the organizers 😉

Algorithmic Criticism

Today I want to present I paper which made me think about Digital Humanities. It is called “Algorithmic Criticism” by Stephen Ramsay.

Unlike most of the other papers that only focus new algorithms and new data, this one also focuses on methods how the two parts of the digital humanities can be combined together. He wants to develop a criticism (which is normally a method more used in humanities) that is based on algorithms.

He argues that even in literature research it could be possible to have approached that are a lot more empirical, meaning you have an experiment and quantitative measurement to proove your claims. Another important point that he states that computers might not be ready for that kind of analysis (the paper is from 2005 though), but in future may be, so he believes that these methods will become available.

One of the central points is that he argues every critic reads a text using his own assumptions and “sees an aspect” (Wittgenstein) in the text. So the feminist reader sees a feminist aspect of the text, and also the “algorithmic” reader can see the aspect of the computer or can read the text transformed by a computer. The paper at the end presents some research doing tf-idf measures at the novel The Waves by Virignial Woolf.

I really like this idea to have a certain way of reading a text by letting this be done by a machine and that it is considered similar to a human reader, which is also not completely effective and free of bias. This also is good for the researcher in NLP, because so you can admit that the judgement the computer gives is also not free of bias, for instance if you change the parameters in your algorithm.

 

How to be a modern scientist, Google Tensorflow

This post I want to share a few things that just came to me the last couple of weeks and think there are worth sharing:

There is a new episode on Open Science Radio. This is a German podcast about Open Science and other stuff that is related. They also have some episodes. One thing they talk about it is Jeffrey Leek, a researcher in (bio-)statistics who wrote a book about being a modern scientist, which you can get for free or for a donation. And he also teaches classes via Cursera in Data Science. I can also recommend a lot episode 59 of open science radio about OpenML, which I think is also a very cool project

Google is open sourcing a tool for visualization of high dimensional data, Tensor Flow. The standard visualization shows word vectors. In my opinion this visualization is a little tricky because stuff that appears to be close in this three-dimensional view is in the real vector space with a couple hundred dimensions not close. But it is still a nice tool in order to explore how word vectors behave on a very large dataset that you do not even have to train yourself. You can also use the tool for plotting other high dimensional data.

Semantic Web Technologies – OWL, Rules and Reasoning

Summary of week four for the course Knowledge Engineering with Semantic Web Technologies 2015 by Harald Sack at OpenHPI.

RDFS Semantics: we need this because there was no formal description of the semantics and then the same querys gave back different results. So you add semantics. Every triple encoded in RDF is a statement and also a RDF-graph is also a statement.

OWL: based on a description logic it consists of classes, properties and individuals (instances of classes)

OWL2 has different flavors with three different dialects (EL, RL, QL), DL (based on description logic and Full (DL is decidable, Full is not). There are different ways to create ontologies. The most important (and shortest) are Manchester Syntax and Turtle.

Classes, properties and individuals in OWL are comparable with the ones in RDFS.

OWL contains NamedIndividuals, which can be introduced directly.

An editor for Ontologies is protege, which can be used as web or desktop application, there are also short courses at their homepage.

Deeper knowledge about OWL in the extra lectures.

 

Semantic Web Technologies – Ontology and logic

Summary of week three for the course Knowledge Engineering with Semantic Web Technologies 2015 by Harald Sack at OpenHPI.

This lecture deals with ontologies. If you want to speak a common language, you need:

  • common symbols and concepts (Syntax)
  • agreement about their meaning (Semantics)
  • classification of concepts (Taxonomy)
  • associations and relations of concepts (Thesauri)
  • rules and knowledge about which relations are allowed and make sense (Ontologies) (Dr. Harald Sack: Knowledge Engineering with Semantic Web Technologies presentation slides; Lecture 3: Ontologies and Logic 3.1 Ontologies Basics, Autumn 2015)

We define knowledge as a subset of true beliefs. A formal representation of this are ontologies. In philosophy it is also defined as the study of the nature of being and existence and basic categories for beings. In Computer Science: An Ontology is an explicit formal specification of a shared conceptualization (Thomas Gruber – A Translation Approach to Portable Ontology Specifications) Its principles are:

  • concept: model of the world
  • explicit: must be specified
  • formal: must be machine-readable
  • shared: all must understand it the same way

You can divide ontologies by two ways:

  • On their level of generality (top level ontologies that categorize everything in the world (example by John F. Sowa)), or specific for a model, a task or an application
  • On their level of expressivity (how much can you get out of an ontology?)
  • The next thing we need is formal logic. We need formal logic because with formal logic we can deduce things automatically which we cannot do using informal logic. We need propositional logic (make propositions based on true/false values)and first order logic to do this. For a formula the following terms are defined:
  • tautological: all interpretations are true
  • satisfyable: if a model exists for the formula
  • refutable: if exists an interpretation which is not a model
  • unsatisfiable: if no model exists

The next lecture was the tableaux algorithm. This one is used for automated reasoning. You basically create a decision tree and proof by refusion. Lecture 8 deals with description logic. It is important to know that there are several description logics out there. We do not use first order logic to build our ontologies because it would be too bulky. Part 9 deals with different assumptions for the logic:

  • No Unique name Assumption: in description logic individuals can have more than one name, therefore you have to specify that.
  • Open World Assumption: in an empty ontology, everything is possible. You define only what is forbidden.<> Closed World Assumption: Everything that cannot be shown to be true is false, so you have to define everything while creating it –> Databases.

 

Semantic Web Technologies – RDFS and SPARQL

Summary of week two for the course Knowledge Engineering with Semantic Web Technologies 2015 by Harald Sack at OpenHPI.

Reification allows you to make reference statements. Therefore a statement also gets an URL. It also allows you to make statements about statements and assumptions about assumptions (e.g. Sherlock Holmes thinks that the gardener murdered the butler).

RDFS or RDF Schema puts this further. It adds more semantic expressivity, you can get more knowledge out of the graph. It is also the simplest of the modelling languages (OWL is another, but will be covered later) and describes vocabularies for RDF. What can we do with it? We can build classes to model structures (Planet is class, satellite is subclass of planet, artificical satellite is subclass…, earth is planet, moon is planet and planet of earth, sputnik is artifical satellite and satellite of earth). From this we can infer some information like: an artificial satellite, is also a satellite. Sputnik is an artificial satellite of earth, so it is also a satellite of Earth!

The rest of the lecture focused on SPARQL. This is the language to query knowledge bases stored in RDF. It is similar to SQL syntactacally, but works somehow different because in RDF we are dealing with graphs. You can use it via an endpoint, which is an RDF database that has a SPARQL protocol layer and gives back HTML. It offers you:

  • extraction of data
  • exploration
  • transformation
  • construction of new graphs
  • update graphs
  • logical entailment (inferences)

Results are returned as a triple pattern in turtle + variables. You somehow define a subgraph that the query has to match. Query example at DBPedia. As you can see the syntax is close to SQL, it also offers you filters to reduce the amount of results. If you want to try out SPARQL, OpenHPI recommend the use of Fuseki  or Wikidata.

 

 

 

How to make your own Raspberry Pi Musicbox

This is not about NLP, but I think it is worth sharing, so here we go 😉

I really like the project PiMusicbox, the raspberry pi is just the perfect device to host a music server, especially the model B1, which is also a little bit slow when it comes to video playback. But there are a few drawbacks, like that updates are quite hard and you cannot easily customize it. So I just set up the system in a different way, directly from scrath on Raspbian. In the next steps I show you how.

Thoughts before you start

This is what comes to my mind if someone asks me if she whether should take the normal version of PiMusicbox or mine.

Pros

  • You can update all the time. PiMusicbox you have to reinstall with every new release.
  • You can customize it as you want. The normal PiMusicbox does not provide Podcasts or Files.

Cons

  • Configuration is done manually. You should be able to connect to your pi via ssh. Alternatively use the Websettings package.
  • You do not have a way shutdown button integrated. But you can use RaspiCheck.
  • It is slower. In PiMusicbox a few tweaks are done to improve booting of the system. I did not do that.

Download Raspbian minimal image

You can get this directly from the website of Raspbian: https://www.raspberrypi.org/downloads/raspbian/

Install mopidy + run as system service

In order to start it when the system boots, you only have to type (source)

sudo systemctl enable mopidy

Install add-ons

I used Spotify, Podcast and files, because these are all I use with the raspi. You can get an overview at the documentation of Mopidy. Generally speaking you can download all extensions either via pip or via apt, depending on in which repo they are. This makes it sometimes a little bit confusing, but you’ll find everything, I am sure 😉 You can find all of the extensions for playback (the documentation calls them backend-extensions in the mopidy-documentation).

Also, you need an extension for a HTML-frontend. I used the one made for the PiMusicbox. An overview can be found here.

Mounting your external storage automatically

For this I used usbmount, which is a small programm that just mounts external storage devices automatically. This can of course be done via scripts as  well, but I did not want to mess around with scripts, so I used this approach.

Configurations

The config file for mopidy can be found at /etc/mopidy/mopidy.conf, if you run it as a system service, not in your user’s directory. To shorten this paragraph I just paste my config file here and make some comments:

[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy

[logging]
config_file = /etc/mopidy/logging.conf
debug_file = /var/log/mopidy/mopidy-debug.log

[local]
data_dir = /var/lib/mopidy/local
media_dir = /var/lib/mopidy/media

[m3u]
playlists_dir = /var/lib/mopidy/playlists

[musicbox_webclient]
enabled = true


username = # your username
password =  # your password
bitrate = 320 # better sound quality

[http]
hostname=0.0.0.0 # VERY important. Otherwise you cannot reach it from outside

[mpd]
hostname=0.0.0.0 # VERY important. Otherwise you cannot reach it from outside

[podcast]
enabled = true #only need to activate it. 
browse_root = #Path where your .opml-file with all your podcasts is

[file]
enabled = true
media_dirs = /media/usb #this is where your external storage is mounted via usbmount
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

I hope this tutorial helped you.

Bonus: Setting up SMB share

If you have a hard disk connected to your Raspi, you can easily share the files in all your network. I used the tutorial given by putokaz to install and configure it. I just configured it like the share for the torrent files at the end of the tutorial, but this is up to you.