JonnyFLDN / Federal-Reserve-Minutes-Topic-and-Sentiment-Modelling

18 stars 6 forks source link

"embedding_from_last" be returned with None #7

Open shuxinjin opened 1 year ago

shuxinjin commented 1 year ago

\utils\featureutils.py", line 195, in _embedding_mean_pool mask = attention_mask.unsqueeze(-1).expand(embedding_from_last.shape).float()

AttributeError: 'NoneType' object has no attribute 'shape'

Please, is it a right return? If yes, should I add None condition to this part? thanks.

shuxinjin commented 1 year ago

The caller locate in line 320:

latest_minutes = document_feat.get_features(sentiment=True,embedding=True,topic=True)

shuxinjin commented 1 year ago

Should because the model of finbert changing... I have no idea how to correct it, a Junior in this topic.

shuxinjin commented 1 year ago

It looked like not related to the finbert. Strangely no output from "_get_model_output(self, sentiment, embedding, topic)"

shuxinjin commented 1 year ago

image output has one result as snapshot, but "embedding_from_last " be returned with None when run :

"embedding_from_last = output.hidden_states[-1]"

in file of : "featureutils.py"

caller from line 337 "latest_minutes = document_feat.get_features(sentiment=True,embedding=True,topic=True)"