Closed satoshi-2000 closed 11 months ago
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.