tensorflow / models

Models and examples built with TensorFlow
Other
77.18k stars 45.75k forks source link

Error of downloading NewSHead dataset #10444

Closed StevenTang1998 closed 2 years ago

StevenTang1998 commented 2 years ago

Following the readme, I run news-please -c news_please, and the following error orrurs:

[newsplease.config:161|INFO] Loading config-file (news-please/config.cfg)
Traceback (most recent call last):
  File "/home/miniconda3/bin/news-please", line 8, in <module>
    sys.exit(main())
  File "/home/miniconda3/lib/python3.8/site-packages/newsplease/__main__.py", line 701, in main
    plac.call(cli)
  File "/home/miniconda3/lib/python3.8/site-packages/plac_core.py", line 436, in call
    cmd, result = parser.consume(arglist)
  File "/home/miniconda3/lib/python3.8/site-packages/plac_core.py", line 287, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/home/miniconda3/lib/python3.8/site-packages/newsplease/__main__.py", line 697, in cli
    NewsPleaseLauncher(cfg_file_path, resume, reset_elasticsearch, reset_json, reset_mysql, reset_postgresql, no_confirm)
  File "/home/miniconda3/lib/python3.8/site-packages/newsplease/__main__.py", line 110, in __init__
    self.postgresql = self.cfg.section("Postgresql")
  File "/home/miniconda3/lib/python3.8/site-packages/newsplease/config.py", line 181, in section
    return deepcopy(self.__config[section])
KeyError: 'Postgresql'
saberkun commented 2 years ago

@remenberl

remenberl commented 2 years ago

Please install an older version as below. It should solve the config key issue. pip3 install news-please==1.4.26

StevenTang1998 commented 2 years ago

It works. Thanks for you help!!

google-ml-butler[bot] commented 2 years ago

Are you satisfied with the resolution of your issue? Yes No

StevenTang1998 commented 2 years ago

Hello, I have downloaded them and use the script to preprocess them. However, the file is in the tfrecord format and I want to know how I can get the (article, headline) pair in the string format. I want to use them to conduct summarization task in my own model.

Thanks.

remenberl commented 2 years ago

The tfrecord files should contain title and article content by default, as it is controled by this parameter (set to True by default in the main file).

To process tfrecord, please refer to this Tensorflow page

StevenTang1998 commented 2 years ago

Thanks for your help.

After I process them, I want to check if A is the news headline and BCDE is different articles under that headline.

remenberl commented 2 years ago

Yes, A is the headline, followed by different articles.

StevenTang1998 commented 2 years ago

Thank you very much!

google-ml-butler[bot] commented 2 years ago

Are you satisfied with the resolution of your issue? Yes No