Code Monkey home page Code Monkey logo

storm's Introduction

STORM: Synthesis of Topic Outlines through Retrieval and Multi-perspective Question Asking

| Research preview | Paper | Documentation (WIP) |

Latest News 🔥

  • [2024/04] We release refactored version of STORM codebase! We define interface for STORM pipeline and reimplement STORM-wiki (check out src/storm_wiki) to demonstrate how to instantiate the pipeline. We provide API to support customization of different language models and retrieval/search integration.

STORM is a LLM system that writes Wikipedia-like articles from scratch based on Internet search.

While the system cannot produce publication-ready articles that often require a significant number of edits, experienced Wikipedia editors have found it helpful in their pre-writing stage.

Try out our live research preview to see how STORM can help your knowledge exploration journey and please provide feedback to help us improve the system 🙏!

How STORM works

STORM breaks down generating long articles with citations into two steps:

  1. Pre-writing stage: The system conducts Internet-based research to collect references and generates an outline.
  2. Writing stage: The system uses the outline and references to generate the full-length article with citations.

STORM identifies the core of automating the research process as automatically coming up with good questions to ask. Directly prompting the language model to ask questions does not work well. To improve the depth and breadth of the questions, STORM adopts two strategies:

  1. Perspective-Guided Question Asking: Given the input topic, STORM discovers different perspectives by surveying existing articles from similar topics and uses them to control the question-asking process.
  2. Simulated Conversation: STORM simulates a conversation between a Wikipedia writer and a topic expert grounded in Internet sources to enable the language model to update its understanding of the topic and ask follow-up questions.

Based on the separation of the two stages, STORM is implemented in a highly modular way using dspy.

Getting started

1. Setup

Below, we provide a quick start guide to run STORM locally.

  1. Install the required packages.
    conda create -n storm python=3.11
    conda activate storm
    pip install -r requirements.txt
  2. Set up OpenAI API key (if you want to use OpenAI models to power STORM) and You.com search API key. Create a file secrets.toml under the root directory and add the following content:
    # Set up OpenAI API key.
    OPENAI_API_KEY="your_openai_api_key"
    # If you are using the API service provided by OpenAI, include the following line:
    OPENAI_API_TYPE="openai"
    # If you are using the API service provided by Microsoft Azure, include the following lines:
    OPENAI_API_TYPE="azure"
    AZURE_API_BASE="your_azure_api_base_url"
    AZURE_API_VERSION="your_azure_api_version"
    # Set up You.com search API key.
    YDC_API_KEY="your_youcom_api_key"

2. Running STORM-wiki locally

Currently, we provide example scripts under examples to demonstrate how you can run STORM using different models.

To run STORM with gpt family models: Make sure you have set up the OpenAI API key and run the following command.

python scripts/run_storm_wiki_gpt.py \
    --output_dir $OUTPUT_DIR \
    --do-research \
    --do-generate-outline \
    --do-generate-article \
    --do-polish-article
  • --do-research: if True, simulate conversation to research the topic; otherwise, load the results.
  • --do-generate-outline: If True, generate an outline for the topic; otherwise, load the results.
  • --do-generate-article: If True, generate an article for the topic; otherwise, load the results.
  • --do-polish-article: If True, polish the article by adding a summarization section and (optionally) removing duplicate content.

To run STORM with mistral family models on local VLLM server: have a VLLM server running with the Mistral-7B-Instruct-v0.2 model and run the following command.

python scripts/run_storm_wiki_mistral.py \
    --url $URL \
    --port $PORT \
    --output_dir $OUTPUT_DIR \
    --do-research \
    --do-generate-outline \
    --do-generate-article \
    --do-polish-article
  • --url URL of the VLLM server.
  • --port Port of the VLLM server.

Customize STORM

Customization of the Pipeline

STORM is a knowledge curation engine consisting of 4 modules:

  1. Knowledge Curation Module: Collects a broad coverage of information about the given topic.
  2. Outline Generation Module: Organizes the collected information by generating a hierarchical outline for the curated knowledge.
  3. Article Generation Module: Populates the generated outline with the collected information.
  4. Article Polishing Module: Refines and enhances the written article for better presentation.

The interface for each module is defined in src/interface.py, while their implementations are instantiated in src/storm_wiki/modules/*. These modules can be customized according to your specific requirements (e.g., generating sections in bullet point format instead of full paragraphs).

🌟 You can share your customization of Engine by making PRs to this repo!

Customization of Retriever Module

As a knowledge curation engine, STORM grabs information from the Retriever module. The interface for the Retriever module is defined in src/interface.py. Please consult the interface documentation if you plan to create a new instance or replace the default search engine API. By default, STORM utilizes the You.com search engine API (see YouRM in src/rm.py).

🌟 PRs for integrating more search engines/retrievers are highly appreciated!

Customization of Language Models

STORM provides the following language model implementations in src/lm.py:

  • OpenAIModel
  • ClaudeModel
  • VLLMClient
  • TGIClient
  • TogetherClient

🌟 PRs for integrating more language model clients are highly appreciated!

💡 For a good practice,

  • choose a cheaper/faster model for conv_simulator_lm which is used to split queries, synthesize answers in the conversation.
  • if you need to conduct the actual writing step, choose a more powerful model for article_gen_lm. Based on our experiments, weak models are bad at generating text with citations.
  • for open models, adding one-shot example can help it better follow instructions.

Please refer to the scripts in the examples directory for concrete guidance on customizing the language model used in the pipeline.

Replicate NAACL2024 result

Please switch to the branch NAACL-2024-code-backup

Show me instructions

Paper Experiments

The FreshWiki dataset used in our experiments can be found in ./FreshWiki.

Run the following commands under ./src.

Pre-writing Stage

For batch experiment on FreshWiki dataset:

python -m scripts.run_prewriting --input-source file --input-path ../FreshWiki/topic_list.csv  --engine gpt-4 --do-research --max-conv-turn 5 --max-perspective 5
  • --engine (choices=[gpt-4, gpt-35-turbo]): the LLM engine used for generating the outline
  • --do-research: if True, simulate conversation to research the topic; otherwise, load the results.
  • --max-conv-turn: the maximum number of questions for each information-seeking conversation
  • --max-perspective: the maximum number of perspectives to be considered, each perspective corresponds to an information-seeking conversation.
    • STORM also uses a general conversation to collect basic information about the topic. So, the maximum number of QA pairs is max_turn * (max_perspective + 1). 💡 Reducing max_turn or max_perspective can speed up the process and reduce the cost but may result in less comprehensive outline.
    • The parameter will not have any effect if --disable-perspective is set (the perspective-driven question asking is disabled).

To run the experiment on a single topic:

python -m scripts.run_prewriting --input-source console --engine gpt-4 --max-conv-turn 5 --max-perspective 5 --do-research
  • The script will ask you to enter the Topic and the Ground truth url that will be excluded. If you do not have any url to exclude, leave that field empty.

The generated outline will be saved in {output_dir}/{topic}/storm_gen_outline.txt and the collected references will be saved in {output_dir}/{topic}/raw_search_results.json.

Writing Stage

For batch experiment on FreshWiki dataset:

python -m scripts.run_writing --input-source file --input-path ../FreshWiki/topic_list.csv --engine gpt-4 --do-polish-article --remove-duplicate
  • --do-polish-article: if True, polish the article by adding a summarization section and removing duplicate content if --remove-duplicate is set True.

To run the experiment on a single topic:

python -m scripts.run_writing --input-source console --engine gpt-4 --do-polish-article --remove-duplicate
  • The script will ask you to enter the Topic. Please enter the same topic as the one used in the pre-writing stage.

The generated article will be saved in {output_dir}/{topic}/storm_gen_article.txt and the references corresponding to citation index will be saved in {output_dir}/{topic}/url_to_info.json. If --do-polish-article is set, the polished article will be saved in {output_dir}/{topic}/storm_gen_article_polished.txt.

Customize the STORM Configurations

We set up the default LLM configuration in LLMConfigs in src/modules/utils.py. You can use set_conv_simulator_lm(),set_question_asker_lm(), set_outline_gen_lm(), set_article_gen_lm(), set_article_polish_lm() to override the default configuration. These functions take in an instance from dspy.dsp.LM or dspy.dsp.HFModel.

Automatic Evaluation

In our paper, we break down the evaluation into two parts: outline quality and full-length article quality.

Outline Quality

We introduce heading soft recall and heading entity recall to evaluate the outline quality. This makes it easier to prototype methods for pre-writing.

Run the following command under ./eval to compute the metrics on FreshWiki dataset:

python eval_outline_quality.py --input-path ../FreshWiki/topic_list.csv --gt-dir ../FreshWiki --pred-dir ../results --pred-file-name storm_gen_outline.txt --result-output-path ../results/storm_outline_quality.csv

Full-length Article Quality

eval/eval_article_quality.py provides the entry point of evaluating full-length article quality using ROUGE, entity recall, and rubric grading. Run the following command under eval to compute the metrics:

python eval_article_quality.py --input-path ../FreshWiki/topic_list.csv --gt-dir ../FreshWiki --pred-dir ../results --gt-dir ../FreshWiki --output-dir ../results/storm_article_eval_results --pred-file-name storm_gen_article_polished.txt

Use the Metric Yourself

The similarity-based metrics (i.e., ROUGE, entity recall, and heading entity recall) are implemented in eval/metrics.py.

For rubric grading, we use the prometheus-13b-v1.0 introduced in this paper. eval/evaluation_prometheus.py provides the entry point of using the metric.

Contributions

If you have any questions or suggestions, please feel free to open an issue or pull request. We welcome contributions to improve the system and the codebase!

Contact person: Yijia Shao and Yucheng Jiang

Citation

Please cite our paper if you use this code or part of it in your work:

@inproceedings{shao2024assisting,
      title={{Assisting in Writing Wikipedia-like Articles From Scratch with Large Language Models}}, 
      author={Yijia Shao and Yucheng Jiang and Theodore A. Kanell and Peter Xu and Omar Khattab and Monica S. Lam},
      year={2024},
      booktitle={Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)}
}

storm's People

Contributors

daepicr avatar eltociear avatar gavrielc avatar mahone3297 avatar shaoyijia avatar yucheng-jiang avatar

Stargazers

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

Watchers

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

storm's Issues

Error running run_prewriting.py script with gpt-3.5-turbo

Description:
I encountered an error when trying to run the run_prewriting.py script with the gpt-3.5-turbo engine.

I followed the setup instructions in the README, including:

  • Creating and activating a conda environment
  • Installing required packages

To my error Reproduce:

$ python -m scripts.run_prewriting --input-source console --engine gpt-35-turbo --max-conv-turn 5 --max-perspective 5 --do-research

$ Topic: The promise and technical difficulties of SSTO vehicles

$ Ground truth url (will be excluded from source):  #blank

root : ERROR    : Error occurs when processing h: Invalid URL 'h': No scheme supplied. Perhaps you meant https://h?
root : ERROR    : Error occurs when processing t: Invalid URL 't': No scheme supplied. Perhaps you meant https://t?
root : ERROR    : Error occurs when processing n: Invalid URL 'n': No scheme supplied. Perhaps you meant https://n?
root : ERROR    : Error occurs when processing n: Invalid URL 'n': No scheme supplied. Perhaps you meant https://n?
root : ERROR    : Error occurs when processing m: Invalid URL 'm': No scheme supplied. Perhaps you meant https://m?
engine : INFO     : _research_topic executed in 85.8730 seconds
openai : INFO     : error_code=None error_message='Invalid URL (POST /v1/engines/gpt-3.5-turbo/chat/completions)' error_param=None error_type=invalid_request_error message='OpenAI API error received' stream_error=False
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "Z:\Projects\storm\src\scripts\run_prewriting.py", line 96, in <module>
    main(parser.parse_args())
  File "Z:\Projects\storm\src\scripts\run_prewriting.py", line 54, in main
    runner.run(topic=topic,
  File "Z:\Projects\storm\src\engine.py", line 405, in run
    outline = self._generate_outline(topic, conversations, callback_handler)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Z:\Projects\storm\src\engine.py", line 26, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "Z:\Projects\storm\src\engine.py", line 222, in _generate_outline
    result = write_outline(topic=topic, dlg_history=sum(conversations, []), callback_handler=callback_handler)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dspy\primitives\program.py", line 29, in __call__
    return self.forward(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Z:\Projects\storm\src\modules\write_page.py", line 179, in forward
    old_outline = clean_up_outline(self.draft_page_outline(topic=topic).outline)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dspy\predict\predict.py", line 60, in __call__
    return self.forward(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dspy\predict\predict.py", line 87, in forward
    x, C = dsp.generate(signature, **config)(x, stage=self.stage)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dsp\primitives\predict.py", line 78, in do_generate
    completions: list[dict[str, Any]] = generator(prompt, **kwargs)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Z:\Projects\storm\src\modules\utils.py", line 73, in __call__
    response = self.request(prompt, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dsp\modules\gpt3.py", line 136, in request
    return self.basic_request(prompt, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dsp\modules\gpt3.py", line 109, in basic_request
    response = chat_request(**kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dsp\modules\gpt3.py", line 247, in chat_request
    return _cached_gpt3_turbo_request_v2_wrapped(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dsp\modules\cache_utils.py", line 17, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dsp\modules\gpt3.py", line 221, in _cached_gpt3_turbo_request_v2_wrapped
    return _cached_gpt3_turbo_request_v2(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\joblib\memory.py", line 655, in __call__
    return self._cached_call(args, kwargs)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\joblib\memory.py", line 598, in _cached_call
    out, metadata = self.call(*args, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\joblib\memory.py", line 856, in call
    output = self.func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\dsp\modules\gpt3.py", line 216, in _cached_gpt3_turbo_request_v2
    return cast(OpenAIObject, openai.ChatCompletion.create(**kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 155, in create
    response, _, api_key = requestor.request(
                           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\openai\api_requestor.py", line 299, in request
    resp, got_stream = self._interpret_response(result, stream)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\openai\api_requestor.py", line 710, in _interpret_response
    self._interpret_response_line(
  File "C:\Users\me\anaconda3\envs\storm\Lib\site-packages\openai\api_requestor.py", line 775, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: Invalid URL (POST /v1/engines/gpt-3.5-turbo/chat/completions)


$ python -m scripts.run_writing --input-source console --engine gpt-35-turbo --do-polish-article --remove-duplicate
Topic: The promise and technical difficulties of SSTO vehicles
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "Z:\Projects\storm\src\scripts\run_writing.py", line 94, in <module>
    main(parser.parse_args())
  File "Z:\Projects\storm\src\scripts\run_writing.py", line 54, in main
    runner.run(topic=topic,
  File "Z:\Projects\storm\src\engine.py", line 410, in run
    url_to_info = load_json(
                  ^^^^^^^^^^
  File "Z:\Projects\storm\src\modules\utils.py", line 326, in load_json
    with open(file_name, 'r', encoding=encoding) as fr:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '../results\\The_promise_and_technical_difficulties_of_SSTO_vehicles\\raw_search_results.json'

(storm) Z:\Projects\storm\src>

Environment:

Python version: 3.11
Operating System: Windows

Summary:
Got a a few errors when running run_prewriting, despite these errors the script does product a conversation_log.json and raw_search_results.json which look ok.

I then try to run run_writing but this completely fails due to FileNotFoundError: [Errno 2] No such file or directory: '../results\\The_promise_and_technical_difficulties_of_SSTO_vehicles\\raw_search_results.json',

Could aynone please advise on how to resolve these errors? Let me know if any additional information or logs would be helpful for troubleshooting.

requirements.txt issue

I am getting the error below with a fresh git pull. not sure about the best way to solve it

ERROR: Cannot install -r requirements.txt (line 1), -r requirements.txt (line 2), dspy-ai==2.1.1 and tqdm==4.66.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested tqdm==4.66.2
    flair 0.13.0 depends on tqdm>=4.63.0
    nltk 3.8.1 depends on tqdm
    dspy-ai 2.1.1 depends on tqdm<=4.66.1

conversation_log.json not created

Troubleshooting suggestions? thanks.

Traceback (most recent call last):
File "C:\Users...\Desktop\storm-main\storm-main\scripts\run_storm_wiki_gpt.py", line 111, in
main(parser.parse_args())
File "C:\Users...\Desktop\storm-main\storm-main\scripts\run_storm_wiki_gpt.py", line 68, in main
runner.run(
File "C:\Users...\Desktop\storm-main\storm-main\src\storm_wiki\engine.py", line 286, in run
information_table = StormInformationTable.from_conversation_log_file(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users...\Desktop\storm-main\storm-main\src\storm_wiki\modules\storm_dataclass.py", line 145, in from_conversation_log_file
conversation_log_data = FileIOHelper.load_json(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users...\Desktop\storm-main\storm-main\src\utils.py", line 302, in load_json
with open(file_name, 'r', encoding=encoding) as fr:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './results/gpt\newtest\conversation_log.json'

root: Error : Error occours

I would normally say that I didn't do anything. It stopped working from one day to the next, and I reinstalled again. The search engine says searches are coming in, what can I do? Thank you
youcom@2x_fs8

Thanks for help

% python -m scripts.run_prewriting --input-source console --engine gpt-4 --max-conv-turn 5 --max-perspective 5 --do-research
Topic: Solving the 6 W Questions with WardleyMaps
Ground truth url (will be excluded from source):
root : ERROR : Error occurs when searching query What are WardleyMaps?: 'hits'
root : ERROR : Error occurs when searching query Wardley Maps "Who" aspect: 'hits'
root : ERROR : Error occurs when searching query What are the 6 W Questions?: 'hits'
root : ERROR : Error occurs when searching query Can you provide an example of using Wardley Maps to answer the 6 W questions in technology roadmapping?: 'hits'
root : ERROR : Error occurs when searching query Understanding "Who" in Wardley Mapping: 'hits'
root : ERROR : Error occurs when searching query How can WardleyMaps be used to solve the 6 W Questions?: 'hits'
root : ERROR : Error occurs when searching query What are Wardley Maps?: 'hits'
root : ERROR : Error occurs when searching query Identifying stakeholders with Wardley Maps: 'hits'
root : ERROR : Error occurs when searching query What is Wardley Mapping?: 'hits'

ValueError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app).

File "/home/yijia/.conda/envs/storm/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
exec(code, module.dict)
File "/data1/yijia/yuchengj/knowledge_curation/frontend/demo/storm.py", line 236, in
main()
File "/data1/yijia/yuchengj/knowledge_curation/frontend/demo/storm.py", line 233, in main
CreateNewArticle.create_new_article_page()
File "/data1/yijia/yuchengj/knowledge_curation/frontend/demo/pages_util/CreateNewArticle.py", line 122, in create_new_article_page
st.session_state["runner"].run(topic=st.session_state["page3_topic"], do_research=False,
File "/data1/yijia/yuchengj/knowledge_curation/src/storm_wiki/engine.py", line 203, in run
draft_article = self.run_article_generation_module(outline=outline,
File "/data1/yijia/yuchengj/knowledge_curation/src/storm_wiki/engine.py", line 29, in wrapper
result = func(*args, **kwargs)
File "/data1/yijia/yuchengj/knowledge_curation/src/storm_wiki/engine.py", line 119, in run_article_generation_module
draft_article = storm_article_generation.generate_article(callback_handler=callback_handler)
File "/data1/yijia/yuchengj/knowledge_curation/src/storm_wiki/modules/article_generation.py", line 83, in generate_article
section_output_dict_collection.append(future.result())
File "/home/yijia/.conda/envs/storm/lib/python3.9/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/home/yijia/.conda/envs/storm/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/home/yijia/.conda/envs/storm/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/data1/yijia/yuchengj/knowledge_curation/src/storm_wiki/modules/article_generation.py", line 36, in generate_section
collected_info = self.information_table.retrieve_information(queries=section_query,
File "/data1/yijia/yuchengj/knowledge_curation/src/storm_wiki/modules/dataclass.py", line 166, in retrieve_information
sim = cosine_similarity([encoded_query], self.encoded_snippets)[0]
File "/home/yijia/.conda/envs/storm/lib/python3.9/site-packages/sklearn/utils/_param_validation.py", line 213, in wrapper
return func(*args, **kwargs)
File "/home/yijia/.conda/envs/storm/lib/python3.9/site-packages/sklearn/metrics/pairwise.py", line 1657, in cosine_similarity
X, Y = check_pairwise_arrays(X, Y)
File "/home/yijia/.conda/envs/storm/lib/python3.9/site-packages/sklearn/metrics/pairwise.py", line 172, in check_pairwise_arrays
Y = check_array(
File "/home/yijia/.conda/envs/storm/lib/python3.9/site-packages/sklearn/utils/validation.py", line 1035, in check_array
raise ValueError(msg)

Alternatives to You.com search API

新版本的readme没有明确指出应该如何启动该项目

非常高兴看到你们更新了版本,但是新版本的readme中并没有像上一个版本那么清晰,我不知道该如何启动项目;
另外想知道你们启动的时候,是使用的python什么版本,看到很多引入路径有问题;

Generation via web UI has many errors on mobile

Generation via the web UI has many errors on a mobile web browser. It works fine on a desktop web browser though. This is manageable, but I'm just documenting it for anyone else who experiences it too.

Responsive website for mobile users

The demo (storm.genie.stanford.edu) doesn't look responsive on some devices.
As illustrated in the figure below: the "Important Note" popup is not responsive and hides the button to continue to the app.

Screenshot 2024-04-16 at 00 54 50

Prompts folder is missing

Great work!

The provided evaluation code includes a argument that references a prompt file path:

parser.add_argument("--prompt_template_path", default="./prompts/eval_prometheus_no_ref.prompt",

However, the expected directory structure in the repository does not include a prompts folder. This discrepancy prevents the code from running successfully as it cannot find the specified file.

no evaluation prompt for replicate the result?

no ./prompts/eval_prometheus_no_ref.prompt file for eval/evaluation_prometheus.py?
Could you please show what this file looks like? Does it directly use the code from https://github.com/kaistAI/prometheus/tree/main?

e.g.
###Task Description:
An instruction (might include an Input inside it), a response to evaluate, a reference answer that gets a score of 5, and a score rubric representing a evaluation criteria are given.

  1. Write a detailed feedback that assess the quality of the response strictly based on the given score rubric, not evaluating in general.
  2. After writing a feedback, write a score that is an integer between 1 and 5. You should refer to the score rubric.
  3. The output format should look as follows: "Feedback: (write a feedback for criteria) [RESULT] (an integer number between 1 and 5)"
  4. Please do not generate any other opening, closing, and explanations.

###The instruction to evaluate:
{orig_instruction}

###Response to evaluate:
{orig_response}

###Reference Answer (Score 5):
{orig_reference_answer}

###Score Rubrics:
[{orig_criteria}]
Score 1: {orig_score1_description}
Score 2: {orig_score2_description}
Score 3: {orig_score3_description}
Score 4: {orig_score4_description}
Score 5: {orig_score5_description}

###Feedback:

如何更改open_ai_base地址

我是通过代理的方式访问openai网站,查看了源码没有找到更新open_ai_base的地址,请帮忙解答,感激不尽

[FYI] We disable the "Create New Article" function at present

Thanks everyone for trying our demo and providing feedback!

Due to very high demand, we have to disable the "Create New Article" function at present since our search API has exceeded its maximum limit in less than two days (#12). You can still see examples on the web demo or opt in for email notification when we bring the function back.

Also, as we are researching on automatic content curation, supporting customized sources is on our roadmap. PRs on integrating other sources are welcome!

The article outline does not match the one in storm_gen_outline.txt

This project is very good, I carefully read the project code, some of the ideas are very wonderful. But I still have some confusion when I read the code.

I noticed that the outline argument was not used in the forward function of the ConvToSection class. In this way, articles generated by the write_section object only correspond to the level 1 outline. The suboutline generated in the chapter content is inconsistent with the suboutline generated in storm_gen_outline.txt, which appears to serve only the function of retrieving fragments under the first level outline.

class ConvToSection(dspy.Module):
    """Use the information collected from the information-seeking conversation to write a section."""

    def __init__(self, engine: Union[dspy.dsp.LM, dspy.dsp.HFModel]):
        super().__init__()
        self.write_section = dspy.Predict(WriteSection)
        self.engine = engine

    def forward(self, topic: str, outline: str, section: str, searched_url_to_snippets: dict):
        info = ''
        for n, r in enumerate(searched_url_to_snippets.values()):
            info += f'[{n + 1}]\n' + '\n'.join(r)
            info += '\n\n'

        info = limit_word_count_preserve_newline(info, 1500)

        with dspy.settings.context(lm=self.engine):
            section = clean_up_section(
                self.write_section(topic=topic, info=info, section=section).output)

        return dspy.Prediction(section=section)

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.