Code Monkey home page Code Monkey logo

python_asa's People

Contributors

clrafaelr avatar koichi609 avatar takeuchi-lab-lm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

python_asa's Issues

連続英文が入ると弾けるようです。

py .\test.py

Traceback (most recent call last):
File ".\test.py", line 24, in
asa.parse(sent)
File "C:\Users\power\Desktop\Project\Dev\J-Web-Novel-Translator-Telegram-Bot\asapy\ASA.py", line 20, in parse
self.result = self.parser.parse(sentence)
File "C:\Users\power\Desktop\Project\Dev\J-Web-Novel-Translator-Telegram-Bot\asapy\parse\Parse.py", line 22, in parse
result = self.__parseChunk(line)
File "C:\Users\power\Desktop\Project\Dev\J-Web-Novel-Translator-Telegram-Bot\asapy\parse\Parse.py", line 32, in __parseChunk
result = self.analyzer.parse(line)
File "C:\Users\power\Desktop\Project\Dev\J-Web-Novel-Translator-Telegram-Bot\asapy\parse\analyzer\Analyzer.py", line 25, in parse
result.chunks[-1].addMorph(Morph(m_id, line))
File "C:\Users\power\Desktop\Project\Dev\J-Web-Novel-Translator-Telegram-Bot\asapy\result\Morph.py", line 23, in init
self.initMorph(m_id, line)
File "C:\Users\power\Desktop\Project\Dev\J-Web-Novel-Translator-Telegram-Bot\asapy\result\Morph.py", line 43, in initMorph
self.base = div2[6]
IndexError: list index out of range

原文: 俺は今ガールズバンドRoseliaの今井リサさんと二人でショッピングモールを見て回っている。

RoseliaのRosまで入れると作動しますが、Roseからはじける現象が発生します。 英文の基準があるんですか。 英語の文字がある時にはうまくいくかどうかが基準が曖昧です。

How to suppress "verbose" semantic info?

@Takeuchi-Lab-LM

Currently, I'm analyzing some transitive sentences with python-asa. I would like to get only argument structure information, but the returns contain unrelated (and unwanted --at least for me--) semantic information of each noun phrase.

Suppose the case in which we typed the sentence 「太郎は次郎を追いかけた。」. It would be analysed as follows.

太郎は次郎を追いかけた。
4.0
[(4.0,
  {'arg': 'Arg1',
   'category': '人',
   'causative_part': 'を',
   'noun': 'スリ',
   'part': 'を',
   'passive_part': 'が',
   'semrole': '対象',
   'weight': 2.0},
  <asapy.result.Chunk.Chunk object at 0x7f9c3228c048>)]
0
[]
============================
[('状態変化なし(活動)-情報・解決策を得るための動作-追求--',
  4.0,
  [(4.0,
    {'arg': 'Arg1',
     'category': '人',
     'causative_part': 'を',
     'noun': 'スリ',
     'part': 'を',
     'passive_part': 'が',
     'semrole': '対象',
     'weight': 2.0},
    <asapy.result.Chunk.Chunk object at 0x7f9c3228c048>)]),
 ('状態変化なし(活動)-反復・継続-反復・継続-引き続く-', 0, [])]
sentence: 太郎は次郎を追いかけた。
ID: 0 太郎は
        link: 2
        type: elem
        main: 太郎
        part: は
        category: 人
        semrole: 対象
        arg: Arg1
        score: 4.0
        frame: 2-verb
        tense: PRESENT
                0       太郎    タロウ  太郎    名詞,固有名詞,人名,名                   B-PERSON
                1       は      ハ      は      助詞,係助詞                     O
ID: 1 次郎を
        link: 2
        type: elem
        main: 次郎
        part: を
        frame: 2-verb
        tense: PRESENT
                0       次      ジ      次      接頭詞,名詞接続                 O
                1       郎      ロウ    郎      名詞,一般                       O
                2       を      ヲ      を      助詞,格助詞,一般                        O
ID: 2 追いかけた。
        link: -1
        type: verb
        main: 追いかける
        part: た
        score: 4.0
        semantic: 状態変化なし(活動)-情報・解決策を得るための動作-追求--
        frame: 0-対象-Arg1,1-elem
        voice: ACTIVE
        tense: PAST
        sentelem: PREDICATE
        polarity: AFFIRMATIVE
        mood: INDICATIVE
                0       追いかけ        オイカケ        追いかける      動詞,自立       一段    連用形  O
                1       た      タ      た      助動詞  特殊・タ        基本形  O
                2       。      。      。      記号,句点                       O
elapsed_time:0.11530041694641113[sec]

Here, we got the information of its argument structure like:

sentence: 太郎は次郎を追いかけた。
ID: 0 太郎は
        link: 2
        type: elem
        main: 太郎
        part: は
        category: 人
        semrole: 対象
        arg: Arg1
        score: 4.0
        frame: 2-verb
        tense: PRESENT
                0       太郎    タロウ  太郎    名詞,固有名詞,人名,名                   B-PERSON
                1       は      ハ      は      助詞,係助詞                     O
ID: 1 次郎を
        link: 2
        type: elem
        main: 次郎
        part: を
        frame: 2-verb
        tense: PRESENT
                0       次      ジ      次      接頭詞,名詞接続                 O
                1       郎      ロウ    郎      名詞,一般                       O
                2       を      ヲ      を      助詞,格助詞,一般                        O
ID: 2 追いかけた。
        link: -1
        type: verb
        main: 追いかける
        part: た
        score: 4.0
        semantic: 状態変化なし(活動)-情報・解決策を得るための動作-追求--
        frame: 0-対象-Arg1,1-elem
        voice: ACTIVE
        tense: PAST
        sentelem: PREDICATE
        polarity: AFFIRMATIVE
        mood: INDICATIVE
                0       追いかけ        オイカケ        追いかける      動詞,自立       一段    連用形  O
                1       た      タ      た      助動詞  特殊・タ        基本形  O
                2       。      。      。      記号,句点                       O
elapsed_time:0.11530041694641113[sec]

However, we also received some irrelevant information on the noun phrases as follows (I'm not sure why 太郎 and 次郎 can be 'noun': 'スリ' in this instance, too...).

太郎は次郎を追いかけた。
4.0
[(4.0,
  {'arg': 'Arg1',
   'category': '人',
   'causative_part': 'を',
   'noun': 'スリ',
   'part': 'を',
   'passive_part': 'が',
   'semrole': '対象',
   'weight': 2.0},
  <asapy.result.Chunk.Chunk object at 0x7f9c3228c048>)]
0
[]
============================
[('状態変化なし(活動)-情報・解決策を得るための動作-追求--',
  4.0,
  [(4.0,
    {'arg': 'Arg1',
     'category': '人',
     'causative_part': 'を',
     'noun': 'スリ',
     'part': 'を',
     'passive_part': 'が',
     'semrole': '対象',
     'weight': 2.0},
    <asapy.result.Chunk.Chunk object at 0x7f9c3228c048>)]),
 ('状態変化なし(活動)-反復・継続-反復・継続-引き続く-', 0, [])]

Then, the question is how we can suppress this noun info when we put some (transitive) sentences on the command line. Any suggestions are welcome.

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.