Git Product home page Git Product logo

python-heideltime's Introduction

Python-HeidelTime

This is a python wrapper for the multilingual temporal tagger HeidelTime.

For more information about this temporal tagger, please visit : https://github.com/HeidelTime/heideltime

Heideltime needs a Part Of Speech Tagger, by default it uses TreeTagger : http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/. This repo includes TreeTagger scripts for Mac and Linux. Windows users will have to download the appropriate scripts from the TreeTagger home page.

โ— Disclaimer: this repository is not maintained, you are free to use it and adapt it to your needs but you may not get support if needed.

Demo

  1. Clone the current github repo: git clone https://github.com/amineabdaoui/python-heideltime
  2. Install its requirements: pip install -r requirements.txt
  3. Create a python file in the same directory with the following code:
import HeidelTime
hw = HeidelTime.HeidelTimeWrapper('english')
hw.parse('Neil Armstrong was born in 1930')

Future Work

  • Encapsulate the returned tagged string in a python object
  • Find a way to install the appropriate POS tagger files according to the user OS.
  • Package all the necessary parts in the same python package and release it on PyPi.

Pull requests are welcome to improve this wrapper (which is in an early stage).

python-heideltime's People

Contributors

amineabdaoui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-heideltime's Issues

Cannot start HeidelTime

Hi,

I installed pip install python-heideltime-krypton==0.0.2

and when I start a blank python file with your Demo example I have the following error:
Traceback (most recent call last):
File "heideltime.py", line 2, in
import HeidelTime
File "/usr/local/lib/python3.8/dist-packages/HeidelTime/init.py", line 14, in
'english':heideltime_resources.Language.ENGLISH,
AttributeError: Java package 'de.unihd.dbs.uima.annotator.heideltime.resources' is not valid

Do you have a solution or a tip for the missing resource?

Best regards, Christina

didn't output any time expression

Hi,

I just cloned and ran as instructed, but the output to your demo is:

'<?xml version="1.0"?>
<!DOCTYPE TimeML SYSTEM "TimeML.dtd">
<TimeML>
Neil Armstrong was born in 1930
</TimeML>
'

Seems it's not finding any time mention. Any idea?

Thank you!

demo output

Hello,
would you please add a demo to the readme.

Best Regards

Example not working

Environnement

  • MacOS Big Sur

Output

english
Sept 09, 2021 11:50:31 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize
INFO: HeidelTimeStandalone initialized with language english
Sept 09, 2021 11:50:31 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone readConfigFile
INFO: trying to read in file config.props
Sept 09, 2021 11:50:33 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize
INFO: HeidelTime initialized
Sept 09, 2021 11:50:33 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize
INFO: JCas factory initialized
Sept 09, 2021 11:50:33 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone process
INFO: Processing started
java.io.IOException: Cannot run program "TreeTagger/bin/tree-tagger": error=86, Bad CPU type in executable
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1142)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
        at de.unihd.dbs.uima.annotator.treetagger.TreeTaggerProperties.getTreeTaggingProcess(TreeTaggerProperties.java:159)
        at de.unihd.dbs.uima.annotator.treetagger.TreeTaggerWrapper.doTreeTag(TreeTaggerWrapper.java:372)
        at de.unihd.dbs.uima.annotator.treetagger.TreeTaggerWrapper.process(TreeTaggerWrapper.java:242)
        at de.unihd.dbs.heideltime.standalone.components.impl.TreeTaggerWrapper.process(TreeTaggerWrapper.java:43)
        at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.establishPartOfSpeechInformation(HeidelTimeStandalone.java:422)
        at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.establishHeidelTimePreconditions(HeidelTimeStandalone.java:332)
        at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.process(HeidelTimeStandalone.java:516)
        at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.process(HeidelTimeStandalone.java:465)
Caused by: java.io.IOException: error=86, Bad CPU type in executable
        at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:313)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1109)
        ... 9 more
java.lang.NullPointerException: Cannot invoke "de.unihd.dbs.uima.annotator.treetagger.TreeTaggerProcess.close()" because "this.ttProc" is null
        at de.unihd.dbs.uima.annotator.treetagger.TreeTaggerWrapper.quit(TreeTaggerWrapper.java:710)
        at de.unihd.dbs.heideltime.standalone.components.impl.TreeTaggerWrapper.reset(TreeTaggerWrapper.java:64)
        at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.establishPartOfSpeechInformation(HeidelTimeStandalone.java:423)
        at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.establishHeidelTimePreconditions(HeidelTimeStandalone.java:332)
        at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.process(HeidelTimeStandalone.java:516)
        at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.process(HeidelTimeStandalone.java:465)
Sept 09, 2021 11:50:33 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone process
WARNING: Processing aborted due to errors
Sept 09, 2021 11:50:33 AM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone process
INFO: Result formatted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.