Skip to content

math domain error #2

@Jacobsonradical

Description

@Jacobsonradical

I encountered this error:

Traceback (most recent call last):
File "/home/rabbitlord/.pyenv/versions/3.11.9/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
File "/home/rabbitlord/.pyenv/versions/3.11.9/lib/python3.11/threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
File "/home/rabbitlord/Project/gpt-detector/exp/exp2/2text_analysis/scripts/taaled/TAALED_1_4_1.py", line 699, in main
indexer(header_list, index_list, "simple_ttr_aw", ttr(lemma_text_aw)[0])
^^^^^^^^^^^^^^^^^^
File "/home/rabbitlord/Project/gpt-detector/exp/exp2/2text_analysis/scripts/taaled/TAALED_1_4_1.py", line 433, in ttr
log_ttr = safe_divide(math.log10(ntypes), math.log10(ntokens))
^^^^^^^^^^^^^^^^^^
ValueError: math domain error

I don't know how to add an exception here because to me, if ntypes == 0, then ntokens == 0 must also be true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions