How to set reference time for SUTime via StanfordNLP server

417 views Asked by At

I am trying to get sutime annotations using the Stanford CoreNLP server and it seems that the reference time cannot be set using any properties on the server.

Is there a way to do this?

For example, given the text "I need a desk for tomorrow from 2pm to 3pm", I need to provide the reference date as datetime.now() in my Python client for the server in order for SUTime to resolve the word 'tomorrow' to the correct date.

1

There are 1 answers

0
Sam Bayer On

There is, at least in Stanford CoreNLP 3.9.1. Send your text to the following URL:

[stanford_server_url]/?properties={"ner.providedDocDate": "yyyy-mm-dd"}

I'd wondered about this myself for quite a while. Had to read the source code to find it, though.