Backgorund [Qiita x COTOHA API present plan] This is a related post.
I extracted the names of people and techniques in I tried to extract the names of players and techniques from sports articles, but here I use UML in this application. I will try to illustrate it.
The approach is to use the COTOHA API for parsing or keyword extraction to get what the player is doing, and then plot it with PlantUML.
I tried to give up a little on Saturday and Sunday holidays (mysterious busy appeal: desktop :), but it seemed like it would take some time to understand the labels in the parsing response, so here's a sports article. I started only the method of illustrating in UML. (Simply time out: hourglass_flowing_sand :)
Dataset Tokyo Sports Same as last time.
https://www.tokyo-sports.co.jp/prores/njpw/1682622/
In the IWGP / US Heavyweight Championship match held at New Japan Pro-Wrestling's biggest box office "Wrestle Kingdom 14" (Tokyo Dome on the 5th), champion John Moxley (34) was the IWGP tag champion Juice Robinson (30). He rejected the challenge and succeeded in his first defense.
At the Tokyo Dome tournament the night before (4th), Moxley regained the title from Lance Archer (32). Juice won the Tag Team Championship in combination with David Finlay (26). The next day, it was a decisive battle between the new champions, but Moxley had robbed Juice of the title in June last year and had declared that he would settle on the ring the night before.
Juice took the lead in the early stages, but Moxley took out a chair outside the venue and hit his back. Furthermore, I bit the forehead of the juice. A rough man who rampaged as a "mad dog" during the WWE era forcibly regained his pace.
Juice counterattacked with a daring high-angle power bomb, but the champion fired a series of unexpected attacks with a four-shaped iron pillar from a four-legged character. The challenger is from the avalanche brainbuster to Jack Hammer and German. I evaded Moxley's Deslider (double-armed DDT) and punched it out with a lariat.
However, the champion flashes a strong running knee from the smashing battle. After turning back the pulp friction of the juice, he exploded a deadly deslider from DDT and took 3 counts at 12 minutes 48 seconds.
After the match, the entrance theme song was played, and Minoru Suzuki (51) suddenly appeared. He was hit by Deslider from Moxley at the Hiroshima tournament on December 8th last year, and he cannot hide his anger with a rugged expression. After taking off the jersey on the flower road and getting ready for battle, he met the champion and elbow on the ring. Powerful Minoru KOed Moxley with a Gotch-type pile driver from rear-naked choke.
Minoru grabbed the microphone and declared war, "Who are you selling fights to, this Yarrow! I'm Minoru Suzuki, a professional wrestler. I'll buy this fight!" The outbreak of the "rabies" vs. "bad guys" conflict over the US Championship has given off a dangerous scent.
Minoru's story "Who are you selling fights to? Hey. I was waiting for you to come in front of me. John Moxley ... No, John Boy, take care of me. I'll kill you."
Juice's story "Everything ends here. Jon Moxley was stronger than me today. I couldn't surpass it again. I thought about today after yesterday's match. Until then, today's match. I didn't think about that. "
Method
Although it is a sports article, unlike free writing such as novels and essays, the format is fixed, and usually the content of when, where, and who played is written on the first line. UML seems to have an atmosphere if you use a package.
Opponents can be obtained by named entity recognition (/ nlp / v1 / ne). (Reference: I tried to extract players and skill names from sports articles)
The concern is how to identify the players who have appeared in past matches. It seems that the player who appears only in this sentence as it was done in the past with "acquired" and "declared" can be judged not to participate in this title match, but the article itself is in the past tense. Since it is written, if you want to judge the past tense, you may judge whether there is a date and time such as "the night before (4th)" or "in June last year". If it can be judged, it is ideal to be able to display it outside the ring.
At the Tokyo Dome tournament the night before (4th), Moxley regained the title from Lance Archer (32). Juice won the Tag Team Championship in combination with David Finlay (26). The next day, it was a decisive battle between the new champions, but Moxley had robbed Juice of the title in June last year and had declared that he would settle on the ring the night before.
I want to write the player name directly without using Player1, but I wrote the name in the field because the structure of writing the script to link to the class allows only alphanumeric characters.
Moxley regains the throne from Lance Archer (32).
When you get or take something from someone, you may want to use a related class.
Juice won the Tag Team Championship in combination with David Finlay (26).
I'm using Composition
to get something.
Moxley took out a chair outside the venue and hit his back.
This expression is a little difficult. You can link directly to the class, but it's hard to tell which part of the player you attacked. Therefore, the following display is displayed as "I attacked the player's back." I also add it to the class's ʻattribute` every time I do something.
Juice counterattacked with a daring high-angle power bomb
When performing a technique on a player, the name of the technique is added to the class ʻattribute`, and who performed the technique is displayed.
Juice's story "Everything ends here. Jon Moxley was stronger than me today. I couldn't surpass it again. I thought about today after yesterday's match. Until then, today's match. I didn't think about that. "
We may write post-match comments in the last few lines. In that case, it seems better to use note instead of a balloon.
Development
I made a script using PlantUML based on the above method.
@startuml
rectangle "Wrestle Kingdom 14 IWGP / US Heavyweight Championship" {
frame Tokyo Dome{
class Player1 {
username =John Moxley
Recapture()
Declaration()
blow()
Biting()
Leg 4 character consolidation()
Deslider (double arm type DDT)()
Running knee()
elbow()
}
class Player2 {
username =Juice Robinson
High angle power bomb()
Avalanche brainbuster()
Jackhammer()
German()
Lariat()
Pulp friction()
elbow()
}
class senaka {
name =back
}
class hitai {
name =amount
}
class Player5 {
username =Minoru Suzuki
elbow()
Rear-naked choke()
Gotch type pile driver()
}
}
}
class Player3 {
username =Lance Archer
}
class Player4 {
username =David finlay
}
class oza {
name =throne
}
class tag_oza {
name =Tag Team Championship
}
Player1 --> Player3 :Recapture>
(Player1, Player3) .. oza
Player2 -- Player4
Player2 *- tag_oza
Player4 *- tag_oza
Player1 --> Player2 :Recapture>
(Player1, Player2) .. oza
Player1 --> senaka :blow>
Player1 --> hitai :Biting>
Player2 *- senaka
Player2 *- hitai
Player2 --> Player1 :High angle power bomb>
Player2 --> Player1 :Leg 4 character consolidation>
Player2 --> Player1 :Avalanche brainbuster>
Player2 --> Player1 :Jackhammer>
Player2 --> Player1 :German>
Player2 --> Player1 :Lariat>
Player1 x-- Player2 :Deslider (double arm type DDT)>
Player1 --> Player2 :Running knee>
Player2 x-- Player1 :Pulp friction>
Player1 --> Player2 :Deslider (double arm type DDT)>
Player1 --> Player5 :elbow>
Player5 --> Player1 :elbow>
Player5 --> Player1 :Rear-naked choke>
Player5 --> Player1 :Gotch type pile driver>
note "Everything ends here.\n John Moxley was stronger than me today.\n I couldn't exceed it again.\n I thought about today after yesterday's match.\n Until then, I hadn't thought about today's game at all" as N1
note "Who are you selling fights to, this Yarrow!\n I'm Minoru Suzuki, a professional wrestler.\n This guy's fight, I'll buy it!" as N2
note "Who are you selling fights to, hey.\n I was waiting for you to come in front of me.\n John Moxley ... No, John Boy, take care of yourself.\n kill" as N3
Player1 .. N1
Player5 .. N2
Player5 .. N3
@enduml
Figure
It seems better to optimize the arrangement of classes and the way of connecting lines to make it easier to see. The output is the default.
Future
Here, I tried to summarize how to illustrate to UML from sports articles. Perhaps there will be some new patterns that you have to think about when trying to illustrate with a few more articles. Next, I need to think about how to extract the master-slave relationship of sentences using COTOHA, but since there is a "dependency label" in the response of parsing (nlp / v1 / parse), this seems to be usable.
:expressionless::expressionless::expressionless::expressionless::expressionless: However, there are many patterns as shown below. It seems to be strict if you do not determine which label will be returned by requesting sentences several times.
Dependency label name | Description | Example | syntax |
---|---|---|---|
nsubj | A noun phrase related to a predicate in the nominative case. | The air is delicious | Delicious → nsubj air |
nsubjpass | A noun phrase related to a nominative case with a passive auxiliary verb. | Hope is entrusted | Entrusted → nsubjpass hope |
dobj | A noun phrase related to a predicate in an object case. | Hold hands | Connect → dobj hand |
iobj | A noun phrase related to a predicate, such as with the case particle "ni". | Give to Hanako | I'll give you → iobj Hanako |
nmod | When modifying a noun phrase with a noun phrase other than "ga", "o", or "ni", or a time phase noun. | Shout here | Shout → nmod here |
csubj | A noun clause that becomes the subject. When a phrase with a quasifield particle is the subject. | Not good at laughing | Poor → csubj laugh |
csubjpass | When modifying a phrase with a passive auxiliary verb when the subject is a phrase with a quasi-body auxiliary verb. | I regret what I said. | Regret → csubjpass say |
ccomp | Supplementary text. | I want to spoil | I think → ccomp |
advcl | Adverbial clause. A clause that modifies a word mainly with a connecting particle. | It ’s mediocre, but that ’s good. | Good → advcl mediocre |
advmod | Modification with adverbs. | Never forgive | Forgiveness → advmod Absolutely |
neg | Grant of negative words. | Never forgive | Forgiveness → neg No |
nummod | Specify the quantity. | 3 books | Book → nummod 3 |
appos | Appositional expression. | Friend (♀) | Friends → appos ♀ |
acl | Attributive clause. However, this does not apply to a mod. Also, connection expressions such as "tekara" and "while". | Gifts with love | Present → acl included |
amod | Adjectives / adjectives / adnominal adjectives(DET(This, that, that, what, etc.)Other than)Modifies a noun without a case. | Great power | Power → amod great |
det | DET(This, that, that, what, etc.)Qualified by. | this book | Book → det this |
compound | A compound of nouns and nouns / verbs and verbs. | Subjective symptoms | Symptoms → compound awareness |
name | A compound word of a proper noun. | Yamada Taro | Yamada → name Taro |
conj | Parallel structure. The element on the left is the head. | Adam and Eve | Adam → conj Eve |
cc | Coordinate conjunction. | Adam and Eve | Adam → cc and |
aux | Auxiliary verbs attached to verbs and non-independent auxiliary verbs. Includes final particles such as "ka". | I want to spoil | Amae → aux want |
auxpass | Auxiliary verbs that connect to a verb to form a passive verb phrase. "Re/Will be. " | Hope is entrusted | Entrusted → auxpass |
cop | Copula. | Taro is a student. | Student → cop |
case | Display of case by particles. | The air is delicious | Air → case |
mark | When subordinate conjunctions, connecting particles, complementizers such as "to" and "ka" are attached. | Not good at laughing | Laugh → mark |
punct | Punctuation. | eat. | Eat → punct punct. |
vocative | Call. | Taro, run | Run → vocative |
discourse | Discourse element. | I'm tired | Tired → discourse Ah |
PostScript
This content has a lot of volume to realize. It seems that it will take time to do everything from some professional wrestling articles to UML and parsing the articles with COTOHA to grasp the characteristics, and writing a script to write in PlantUML once the tendency is grasped. is. [Qiita x COTOHA API present plan] is about freshly made content or how to use COTOHA itself. There are many, but I thought that it might be possible to write in a half-finished state like Sakurada Familia, so I wrote it at the last minute of the deadline: sweat:
Reference
Recommended Posts