dice-group / palmetto-py

Python interface for https://github.com/dice-group/Palmetto
Apache License 2.0
40 stars 9 forks source link

Is there a limit of ten words for the test? How do I test text with more than 10 words? #16

Open ahchchchc opened 1 year ago

ahchchchc commented 1 year ago

Hi. When I ran the provided example, it works. But when I try to enter more words to test, the following error appears:

Traceback (most recent call last): File "/Users/huxinyue/Documents/Programming/temphxy/datapreprocess/eval_npmi_etc.py", line 85, in cp = palmetto.get_coherence(words, coherence_type="cp") File "/Users/huxinyue/opt/anaconda3/envs/spherecluster/lib/python3.7/site-packages/palmettopy/palmetto.py", line 104, in get_coherence return self._get_coherence(words, coherence_type) File "/Users/huxinyue/opt/anaconda3/envs/spherecluster/lib/python3.7/site-packages/palmettopy/palmetto.py", line 91, in _get_coherence coherence = self._request_by_service(words, coherence_type) File "/Users/huxinyue/opt/anaconda3/envs/spherecluster/lib/python3.7/site-packages/palmettopy/palmetto.py", line 33, in _request_by_service raise EndpointDown(request_uri) palmettopy.exceptions.EndpointDown: http://palmetto.aksw.org/palmetto-webapp/service/cp?words=cake%20apple%20banana%20cherry%20chocolate%20chocolate%20chocolate%20chocolate%20chocolate%20chocolate%20chocolate

MichaelRoeder commented 1 year ago

The web service that we host is limited to a maximum number of 10 words.

If you need coherence values for larger word sets, you need to host your own Palmetto service and configure it accordingly. Please have a look at the Palmetto wiki, especially at the part about the configuration.