爱意满满的作品展示区。
jason94

新闻网页正文通用抽取工具 Node.js 版本

  •  
  •   jason94 · Oct 9, 2019 · 2727 views
    This topic created in 2438 days ago, the information mentioned may be changed or developed.

    上个月看到大佬发的/t/599166,国庆研究了一下代码和论文,把大佬的代码用 JavaScript 写了一遍,做了一些修改,目前感觉效果还可以。

    下一步考虑在浏览器中运行。

    repo: zenghongtu/general-news-extractor-js

    online demo: https://general-news-extractor-demo.stayin.cn

    8 replies    2019-10-11 11:28:41 +08:00
    Sanko
        1
    Sanko  
       Oct 9, 2019 via Android
    资瓷
    momocraft
        2
    momocraft  
       Oct 9, 2019
    不是新闻网页(比如没有日期)也适用吗?
    cydian
        3
    cydian  
       Oct 9, 2019 via Android
    图片呢?
    0o0O0o0O0o
        4
    0o0O0o0O0o  
       Oct 9, 2019
    早就想要了,感谢楼主。

    整到了 cloudflare workers 上

    ```sh
    $ curl -s -o test.html http://baijiahao.baidu.com/s?id=1646431966952708911

    $ curl -s -X POST https://demo.extract.workers.dev/demo -d @test.html | jq
    {
    "title": "国庆黄金...000 万人次",
    "author": "",
    "publishTime": "10 月 4 日",
    "content": "..."
    }
    ```
    optional
        5
    optional  
       Oct 9, 2019
    jason94
        6
    jason94  
    OP
       Oct 10, 2019 via Android
    @momocraft 不是日期的问题,算法不适用额
    zjiecode
        7
    zjiecode  
       Oct 11, 2019
    jason94
        8
    jason94  
    OP
       Oct 11, 2019
    @mrjiejiejie 这篇应该正文太短了,最后算出来的分数低了一点,晚点我看看怎么修正
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2726 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 218ms · UTC 11:54 · PVG 19:54 · LAX 04:54 · JFK 07:54
    ♥ Do have faith in what you're doing.