This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Introduction

SoMaJo is a state-of-the-art tokenizer for German web and social media texts that won the EmpiriST 2015 shared task on automatic linguistic annotation of computer-mediated communication / social media. As such, it is particularly well-suited to perform tokenization on all kinds of written discourse, for example chats, forums, wiki talk pages, tweets, blog comments, social networks, SMS and WhatsApp dialogues.

In addition to tokenizing the input text, SoMaJo can also output token class information for each token, i.e. if it is a number, an XML tag, an abbreviation, etc.:

echo 'Wow, superTool!;)' | tokenizer -c -t -
Wow   regular
,     symbol
super regular
Tool  regular
!     symbol
;)    emoticon

New in version 1.1.0: SoMaJo can output additional information for each token that can help to reconstruct the original untokenized text (to a certain extent):

echo 'der beste Betreuer? - >ProfSmith! : )' | tokenizer -c -e -
der
beste
Betreuer      SpaceAfter=No
?
->    SpaceAfter=No, OriginalSpelling="- >"
Prof  SpaceAfter=No
Smith SpaceAfter=No
!
:)    OriginalSpelling=": )"

The -t and -e options can also be used in combination, of course.

The system is described in greater detail in Proisl and Uhrig (2016).

Installation

SoMaJo can be easily installed using pip:

pip install SoMaJo

Usage

Using the tokenizer executable

You can use the tokenizer as a standalone program from the command line. General usage information is available via the -h option:

tokenizer -h

To tokenize a text file according to the guidelines of the EmpiriST 2015 shared task, just call the tokenizer like this:

tokenizer -c <file>

If you do not want to split camel-cased tokens, simply drop the -c option:

tokenizer <file>

The tokenizer can also output token class information for each token, i.e. if it is a number, an XML tag, an abbreviation, etc.:

tokenizer -t <file>

If you want to be able to reconstruct the untokenized input to a certain extent, SoMaJo can also provide you with additional details for each token, i.e. if the token was followed by whitespace or if it contained internal whitespace (according to the tokenization guidelines, things like “: )” get normalized to “:)”):

tokenizer -e <file>

SoMaJo assumes that paragraphs are delimited by empty lines in the input file. If your input file uses single newlines instead, use have to tell that to the tokenizer via the -s or --paragraph_separator option:

tokenizer --paragraph_separator single_newlines <file>

To speed up tokenization, you can specify the number of worker processes used via the --processes option:

tokenizer --processes <number> <file>

Using the module

You can easily incorporate the tokenizer into your own Python projects. All you have to do is import somajo.Tokenizer, create a Tokenizer object and call its tokenize method:

from somajo import Tokenizer

# note that paragraphs are allowed to contain newlines
paragraph = "der beste Betreuer?\n- >ProfSmith! : )"

tokenizer = Tokenizer(split_camel_case=True, token_classes=False, extra_info=False)
tokens = tokenizer.tokenize(paragraph)

print("\n".join(tokens))

Evaluation

SoMaJo was the system with the highest average F₁ score in the EmpiriST 2015 shared task. The performance of the current version on the two test sets is summarized in the following table[1]:

Corpus Precision Recall F₁
CMC 99.62 99.56 99.59
Web 99.83 99.92 99.87
[1]Training and test sets are available from the official website.

References

  • Proisl, Thomas, Peter Uhrig (2016): “SoMaJo: State-of-the-art tokenization for German web and social media texts.” In: Proceedings of the 10th Web as Corpus Workshop (WAC-X) and the EmpiriST Shared Task. Berlin: Association for Computational Linguistics (ACL), 91–96. PDF.
Release History

Release History

1.3.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
SoMaJo-1.3.0.tar.gz (74.1 kB) Copy SHA256 Checksum SHA256 Source Sep 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting