Replies: 8 comments
-
Hi @masakiowari, thanks for this. First thing to check is whether the parser creates a valid CCG tree, you can do this with the following code: tree = parser.sentence2tree("your sentence")
if tree is None:
print("Failure")
else:
print(tree.deriv()) If the sentence has a CCG derivation, then this is probably a lambeq problem. However, if the sentence fails to parse, then this is a problem of the DepCCG parser. Let us know the result. |
Beta Was this translation helpful? Give feedback.
-
Hello! Thank you very much. import sys give an output as Traceback (most recent call last): For the "good" sentence like "これはテストです", As you say that this result may suggest the problem is with the parser. Here, we may emphasize that the "bad sentence" means the sentence for which depccg + Lambeq do give an output. |
Beta Was this translation helpful? Give feedback.
-
By the way, we have modified "ja.py" of depccg to work depccg+Lambeq well. for exampledef generalized_backward_composition1(x: Category, y: Category) -> Optional[CombinatorResult]:
|
Beta Was this translation helpful? Give feedback.
-
@masakiowari Hi, I can't seem to replicate this issue. Could you run this code fragment on your system and show us the full output please? from lambeq import DepCCGParser
parser = DepCCGParser(lang='ja')
sentences = [
'感動的な映画を見る',
'曖昧な表現をする',
'静かな海を見る',
'健康な男性が歩く',
'親切な男性がいる',
'元気な男性が歩く',
'上品な表現をする',
'きれいな海を見る',
'健やかな男性が歩く',
'和やかな雰囲気を感じる',
'穏やかな笑顔を浮かべる',
'正直な男性がいる',
'有名な男性がいる',
'にぎやかな雰囲気を感じる',
'特別な表現をする',
'複雑な表現をする',
'まじめな男性がいる',
'下手な表現をする',
'便利な本を買う',
'朗らかな笑顔を浮かべる',
'幸せな笑顔を浮かべる',
'好きなスープを食べる',
'無理な計画を立てる',
'暇な男性がいる',
'必要な計画を立てる',
'邪魔なものをどかす',
'変な表現をする',
'自由な表現をする'
]
for sentence in sentences:
print(parser.sentence2tree(sentence)) Thank you. |
Beta Was this translation helpful? Give feedback.
-
@ianyfan Thank you very much for your great suggestion! Now, we can treat Adjectival verbs. Unfortunately, however, it seems that there still exit sentences which cannot be treated.
This sentence can be treated in the old environm |
Beta Was this translation helpful? Give feedback.
-
Hi, I've had a look and the issue seems to due to depccg returning a parse that cannot be drawn under standard CCG rules. From your initial list of sentences, there are 4 that lambeq cannot draw:
They all have the same issue. For example, for the first sentence, depccg returns a parse that contains this problematic sub-parse:
depccg tells us which rule it uses at each step, e.g. BA for backwards application. For the bottom rule, depccg provides the rule "other" which clearly isn't a standard CCG rule. Therefore, we cannot draw this tree as a diagram. The example in your comment "ボブはおいしくないカレーが嫌いではない" has a different issue, where depccg tries to perform backwards cross composition (BX) on the types So I'm afraid I'm not sure if we can help you on the lambeq side; this seems to be an issue with how depccg parses these sentences. I hope that helps. Let me know if you have any more questions. |
Beta Was this translation helpful? Give feedback.
-
@ianyfan , Thank you very much for your detailed explanation. |
Beta Was this translation helpful? Give feedback.
-
We'll convert this to a Discussion since it might be useful for other users as well. |
Beta Was this translation helpful? Give feedback.
-
Originally posted by @masakiowari in #24 (comment)
Hello! We are now working on Japanese QNLP by Lambeq following the installation in the description of PR #24. We found that the present version of depccg_jp and Lambeq cannot treat sentences in which an adjectival verb (Keiyo-Do-Shi) modifies a noun. We give a list of sentences in which Lambeq + depccg_jp cannot create any string diagram. E..g
感動的な映画を見る
曖昧な表現をする
静かな海を見る
健康な男性が歩く
親切な男性がいる
元気な男性が歩く
上品な表現をする
きれいな海を見る
健やかな男性が歩く
和やかな雰囲気を感じる
穏やかな笑顔を浮かべる
正直な男性がいる
有名な男性がいる
にぎやかな雰囲気を感じる
特別な表現をする
複雑な表現をする
まじめな男性がいる
下手な表現をする
便利な本を買う
朗らかな笑顔を浮かべる
幸せな笑顔を浮かべる
好きなスープを食べる
無理な計画を立てる
暇な男性がいる
必要な計画を立てる
邪魔なものをどかす
変な表現をする
自由な表現をする
We would like to know anyone who knows how to solve this problem.
By the way, this problem occurs when we use Lambeq ver. 0.2.6 and 0.3.1. We installed depccg_jp following the above instruction. Except for the sentence including adjectival verbs, depccg_jp + Lambeq works very well.
Beta Was this translation helpful? Give feedback.
All reactions