Sign inSign up

liaad/py_heideltime

By liaad

•Updated almost 5 years ago

python wrapper for the multilingual temporal tagger HeidelTime

Image
0

357

liaad/py_heideltime repository overview

⁠py_heideltime

py_heideltime⁠ is a python wrapper for the multilingual temporal tagger HeidelTime, developed by Jorge Mendes⁠ under the supervision of Professor Ricardo Campos⁠ in the scope of the Final Project of the Computer Science degree at the Polytechnic Institute of Tomar⁠, Portugal. This docker version has been developed by Jorge Duque⁠ and Tiago Cândido.

For more information about this temporal tagger, please visit the Heideltime Java standalone version: https://github.com/HeidelTime/heideltime⁠

⁠Main Features (when compared to other python versions)

  • multi-platform (windows, Linux, Mac Os);
  • gives users the chance to choose the granularity (e.g., year, month, etc) of the dates to be extracted;
  • handle texts with emojis (note: heideltime demo and existing packages throw an exception when a text has an emoji);
  • retrieves a normalized version of the text (where each temporal expression is replaced by the normalized Heideltime version); and
  • retrieves a Time-ML annotated version of the text (as done in the Heideltime demo).

⁠Supported Languages

This current version of py_heideltime on Docker supports the following languages:

  • English
  • Portuguese
  • Spanish
  • German
  • Dutch
  • Italian
  • French
  • Estonian
  • Russian

⁠Installing py_heideltime on Docker

⁠Install Docker
⁠Windows

Docker Desktop for Windows requires Microsoft Windows 10 Professional or Enterprise 64-bit, or Windows 10 Home 64-bit with WSL 2 (Windows Subsystem Linux). If you have this, then proceed to download here: (https://hub.docker.com/editions/community/docker-ce-desktop-windows/⁠)

If your system does not meet the requirements to run Docker for Windows (e.g., 64bit Windows 10 Home), you can install Docker Toolbox, which uses Oracle Virtual Box instead of Hyper-V. In that case proceed to download here: (https://docs.docker.com/toolbox/overview/#ready-to-get-started⁠) and click on Get Docker Toolbox for Windows

⁠MAC

Docker for Mac will launch only if all of these requirements (https://docs.docker.com/docker-for-mac/install/#what-to-know-before-you-install⁠) are met. If you have this, then proceed to download here: (https://docs.docker.com/docker-for-mac/install/#download-docker-for-mac⁠) and click on Get Docker for Mac (Stable)

If your system does not meet the requirements to run Docker for Mac, you can install Docker Toolbox, which uses Oracle Virtual Box instead of Hyper-V. In that case proceed to download here: (https://docs.docker.com/toolbox/overview/#ready-to-get-started⁠) and click on Get Docker Toolbox for Mac

⁠Linux

Proceed to download here: (https://docs.docker.com/engine/installation/#server⁠)

⁠Pull Image

Execute the following command on your docker machine:

docker pull liaad/py_heideltime
⁠Run Image

On your docker machine run the following to launch the image:

docker run -p 9999:8888 liaad/py_heideltime

Then go to your browser and type in the following url:

http://<DOCKER-MACHINE-IP>:9999

where the IP may be the localhost or 192.168.99.100 if you are using a Docker Machine VM.

You will be required a token which you can find on your docker machine prompt. It will be something similar to this: http://eac214218126:8888/?token=ce459c2f581a5f56b90256aaa52a96e7e4b1705113a657e8⁠. Copy paste the token (in this example, that would be: ce459c2f581a5f56b90256aaa52a96e7e4b1705113a657e8) to the browser, and voilá, you will have py_heideltime package ready to run. Keep this token (for future references) or define a password.

⁠Run Jupyter notebooks

Once you logged in, proceed by running the notebook that we have prepared for you.

⁠Shutdown

Once you are done go to File - Shutdown.

⁠Login again

If later on you decide to play with the same container, you should proceed as follows. The first thing to do is to get the container id:

docker ps -a

Next run the following commands:

docker start ContainerId
docker attach ContainerId (attach to a running container)

Nothing happens in your docker machine, but you are now ready open your browser as you did before:

http://<DOCKER-MACHINE-IP>:9999

Hopefully, you have saved the token or defined a password. If that is not the case, then you should run the following command (before doing start/attach) to have access to your token:

docker exec -it <docker_container_name> jupyter notebook list
⁠Run Image - background mode

On your docker machine run the following to launch the image in background mode:

docker run -p 9999:8888 -d liaad/py_heideltime

You can then execute py_heideltime in the prompt. An example is given below:

docker run -p 9999:8888 -d liaad/py_heideltime

py_heideltime -t "August 31st ..." -l "English"

Tag summary

Content type

Image

Digest

Size

1.1 GB

Last updated

almost 5 years ago

docker pull liaad/py_heideltime