PrimerAI / blanc

Human-free quality estimation of document summaries
MIT License
94 stars 11 forks source link

Can't run Shannon score #26

Closed mridenour7 closed 2 years ago

mridenour7 commented 2 years ago

I am encountering an error with Shannon score. When I clone the repository and run the example script using python blanc/blanc/shannon.py --simple I get this error:

Traceback (most recent call last):
  File "shannon.py", line 219, in <module>
    results = s.go(doc, summ, measure_t=args.measure_t, measure_summ=args.measure_summ)
  File "shannon.py", line 169, in go
    base_sent_lls, base_sent_success = self.measure(sent_tokens, base_prompt)
  File "shannon.py", line 111, in measure
    probs = F.softmax(logits, dim=-1).view(-1)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py", line 1680, in softmax
    ret = input.softmax(dim)
AttributeError: 'str' object has no attribute 'softmax'

I get the same error if I pip install blanc and try running Shannon score as follows:

from blanc import Shannon
estimator = Shannon()
doc = 'Jack drove his minivan to the bazaar to purchase milk and honey for his large family'
summ = 'Jack bought milk and honey from the bazaar'
estimator.go(doc, summ)
OlegVasilyev4096 commented 2 years ago

Thank you, this issue will be resolved soon