Update: The article “Left hand reads the Dream of Red Mansions, Right hand writes the BUG, idle happy” has carried on the analysis mining to this data set, added many content of the dream of Red Mansions, as well as several obscene jokes in the book, escape. Open-source code at: DesertsX/ Gulius – Projects

Directly above, under the amway the url in the visualization on a dream of red mansions: the InteractiveGraph/example1. If you have recently read “a Dream of Red Mansions” friends, can compare to see, want to be a great experience.

In this relational graph, pink nodes represent the characters in a Dream of Red Mansions. The main characters use stills of some actors in the 1987 version of a Dream of Red Mansions. Click on each node to see the introduction of the characters. Yellow nodes are the main locations in the book; The blue nodes are the main plots and events in the book. You can also see the plot summary after clicking, but not the original content. Although Gu Liu hasn’t read the original book of a Dream of Red Mansions and the 1987 TV series for a long time, they are still very familiar.





You can explore more details by yourself. Gu Liu was amazed when he saw the project. As a “fake” fan of Red, when he saw such a great project, he imagined that he would “die with no regrets” if he could reproduce it himself one day. Fortunately, all the code for this project is also open source on Github-InteractiveGraph.

The README_CN. Md file introduces the specific implementation details, or very detailed, even if there are many technologies have not touched, but also can have a direction. But with the technology, what about the data format? How do you prepare data if you want to migrate to other novels, other texts?

With this doubt found dist/examples/honglou. Json file, simple data extracted from the beginning. Categories define the node types in the diagram above; Translator code skips (==); From the beginning of data to the last 5000 lines, there are all kinds of data of all nodes. The sample data format of event is displayed.

{
  "categories": {
    "person": "Character"."event": "Event"."location": "Location"
  },
  "translator": {
    "nodes": function (node) {
      //set description
      if (node.description === undefined) {
        var description = "<p align=center>";
        if(node.image ! == undefined) { description +="<img src='" + node.image + "' width=150/><br>";
        }
        description += "<b>" + node.label + "</b>" + "[" + node.id + "]";
        description += "</p>";
        if(node.info ! == undefined) { description +="<p align=left>" + node.info + "</p>";
        } else {
          if(node.title ! == undefined) description +="<p align=left>" + node.title + "</p>"; } node.description = description; }}},"data": {
    "nodes": [{
        "label": "Reading the West Wing together."."value": 2."id": 3779,
        "categories": [
          "event"]."info": Baoyu went to qinfang Bridge to read the Story of the West Chamber under the peach blossom. She was about to send the fallen flowers into the pool. Daiyu said she had prepared a grave for them and was burying them. When Daiyu found the Romance of the Western Chamber, Baoyu borrowed some words and phrases from the book and confessed to Daiyu. Daiyu felt that she had offended her dignity and caused a quarrel. Baoyu apologized and begged for mercy. Daiyu also mocked Baoyu by using the words and phrases from the Romance of the Western Chamber. So they gathered the fallen flowers and buried them in the grave.
      },
      {
        "label": "Lin Ruhai Donation Museum, Yangzhou City"."value": 4."id": 3780,
        "categories": [
          "event"]."info": "After Lin Ruhai took the examination to explore flowers, he moved to Lantai Temple doctor and appointed him as the imperial historian of Yangzhou salt patrol. He was so ill that he died from the third of September."
      },
Copy the code

Bao Dai in A Dream of Red Mansions

Location node data style:

{
        "label": "Xiaoxiang Pavilion"."value": 3."id": 3838,
        "categories": [
          "location"]."info": "The residence of Daiyu. Dai Yu wrote the poem under the pen name of Xiaoxiang Concubine, which was cao Xueqin's praise for the character of Dai Yu.
      },
Copy the code

The Treasure Chai in a Dream of Red Mansions

Character node data:

{
        "label": "Wang Xifeng"."value": 25."image": "./images/photo/ Wang Xifeng. JPG"."id": 4041,
        "categories": [
          "person"]."info": "Nine of the twelve Hairpins of Jinling came from the Kings of the four great families, madame Wang's niece and Jia Lian's wife. She is smart and strong, deep jia mother and Lady Wang's trust, become the housekeeper of rongguo Mansion, she is doing things tactful and thoughtful, the things also did a lot of money, in the first 80 back in her support treasure dai love.
      },
Copy the code

Bao Dai in A Dream of Red Mansions:


{
        "id": 3324,
        "label": "Servant"."from": 3876,
        "to": 4103}.Copy the code

Recently, I have also come into contact with some NLP contents such as dependency parsing and information extraction, but it is still far from enough to extract named entity recognition, entity relation extraction, event extraction and so on in the novel. This project can be repeated in the future.

Finally put a 87 version of the dream of red Mansions stills, although really feel that xiaosu’s love of the dream of Red Mansions more than the former. Escape…

Welcome to come to our public account “NIuyi Ancient Willow” (ID: Deserts -x) ha!