A device for relation extraction in a natural language sentence having n words is suggested, the device comprising: a recurrent neural network for joint entity and relation extractions of entities and relations between the entities in the sentence, and an entity-relation table for storing entity labels for the entities and relation labels for the relations, wherein both the entity labels and the relation labels are defined as instances of binary relationships between certain words wi and wj in the sentence, with i∈[1, . . . , n], and j∈[1, . . . , n], wherein each of the entity labels is a first binary relationship for i=j, and wherein each of the relation labels is a second binary relationship for i≠j, wherein the recurrent neural network is configured to fill the cells of the entity-relation table and includes a forward neural network and a backward neural network.