-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is this function correct for calculating NERF? #25
Comments
Hi! Thanks always for visiting my research. TrSF = retrieve(SuPar, preprocessed_features['sent_token']) Can I take a look at the context of this retrieve function? |
Hi! Here is the retrieval function with some lines commented out from this code. Please confirm this function. #def retrieve(SuPar, sent_token_list, n_token, n_sent):
def retrieve(SuPar, sent_token_list):
to_TreeH_C = 0
#to_FTree_C = 0
for sent in sent_token_list:
dataset = SuPar.predict([sent], prob=True, verbose=False)
parsed_tree = dataset.sentences
nltk_tree = nltk.Tree.fromstring(str(parsed_tree[0]))
to_TreeH_C += int(nltk_tree.height())
#to_FTree_C += len(nltk_tree.flatten())
result = {
"to_TreeH_C": to_TreeH_C,
#"as_TreeH_C": float(division(to_TreeH_C,n_sent)),
#"at_TreeH_C": float(division(to_TreeH_C,n_token)),
#"to_FTree_C": to_FTree_C,
#"as_FTree_C": float(division(to_FTree_C,n_sent)),
#"at_FTree_C": float(division(to_FTree_C,n_token)),
}
return result |
Yes. I think your implementation is valid. I apologize that I couldn't put constituency parsing capabilities in LFTK. It was intentional because existing constituency parsing libraries / models are not very well maintained but I wanted to make LFTK as maintainable and lightweight as possible unlike LingFeat. Back in the LingFeat era, many faced problems in installing and using it because of its heavy and complicated dependencies. Which is what I tried to change in LFTK |
Thank you for confirming! I understand. That sounds great! Indeed, LingFeat had complex dependencies. Anyway, I appreciate your sincere comments! |
Hello!
I am seeking to estimate text readability, and to accomplish this, I employed the NERF formula for computation. However, I encountered issues with the LingFeat library due to a dependency problem, as outlined in this GitHub issue.
Despite this setback, I attempted to use the LFTK library and found success.
Nevertheless, there is a disparity in the names of features between LeafFeat and LFTK. Consequently, I am uncertain about the correctness of the correspondence. Additionally, I am unable to locate the variable 'Constituency Parse Tree Height.' In an effort to address this concern, I turned to using the LingFeat library and it worked.
However, due to the differing names of features between LeafFeat and LFTK, I am unsure if the correspondence is correct. Could you please confirm whether this correspondence is accurate, especially regarding the variable 'Constituency Parse Tree Height'?
Thank you in advance.
The text was updated successfully, but these errors were encountered: