mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
feat: add entry for rdagent. (#187)
* Add entries * update entry for rdagent * lint * fix typo
This commit is contained in:
@@ -202,4 +202,4 @@ Making contributions is not a hard thing. Solving an issue(maybe just answering
|
||||
<a href="https://github.com/microsoft/RD-Agent/graphs/contributors"><img src="https://contrib.rocks/image?repo=microsoft/RD-Agent&max=240&columns=18" /></a>
|
||||
|
||||
# Disclaimer
|
||||
**The RD-agent is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. The RD-agent is aimed to facilitate research and development process in the financial industry and not ready-to-use for any financial investment or advice. Users shall independently assess and test the risks of the RD-agent in a specific use scenario, ensure the responsible use of AI technology, including but not limited to developing and integrating risk mitigation measures, and comply with all applicable laws and regulations in all applicable jurisdictions. The RD-agent does not provide financial opinions or reflect the opinions of Microsoft, nor is it designed to replace the role of qualified financial professionals in formulating, assessing, and approving finance products. The inputs and outputs of the RD-agent belong to the users and users shall assume all liability under any theory of liability, whether in contract, torts, regulatory, negligence, products liability, or otherwise, associated with use of the RD-agent and any inputs and outputs thereof.**
|
||||
The RD-agent is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. The RD-agent is aimed to facilitate research and development process in the financial industry and not ready-to-use for any financial investment or advice. Users shall independently assess and test the risks of the RD-agent in a specific use scenario, ensure the responsible use of AI technology, including but not limited to developing and integrating risk mitigation measures, and comply with all applicable laws and regulations in all applicable jurisdictions. The RD-agent does not provide financial opinions or reflect the opinions of Microsoft, nor is it designed to replace the role of qualified financial professionals in formulating, assessing, and approving finance products. The inputs and outputs of the RD-agent belong to the users and users shall assume all liability under any theory of liability, whether in contract, torts, regulatory, negligence, products liability, or otherwise, associated with use of the RD-agent and any inputs and outputs thereof.
|
||||
|
||||
@@ -121,7 +121,7 @@ You can try our demo by running the following command:
|
||||
- 🚀 Run the Application
|
||||
.. code-block:: sh
|
||||
|
||||
python rdagent/app/qlib_rd_loop/factor_w_sc.py
|
||||
rdagent fin_factor
|
||||
|
||||
|
||||
🛠️ Usage of modules
|
||||
|
||||
@@ -121,7 +121,7 @@ You can try our demo by running the following command:
|
||||
- 🚀 Run the Application
|
||||
.. code-block:: sh
|
||||
|
||||
python rdagent/app/qlib_rd_loop/factor_from_report_w_sc.py
|
||||
rdagent fin_factor_report
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ You can try our demo by running the following command:
|
||||
- 🚀 Run the Application
|
||||
.. code-block:: sh
|
||||
|
||||
python rdagent/app/qlib_rd_loop/model_w_sc.py
|
||||
rdagent fin_model
|
||||
|
||||
🛠️ Usage of modules
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -31,6 +31,9 @@ name = "rdagent"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
[project.scripts]
|
||||
rdagent = "rdagent.app.cli:app"
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://github.com/microsoft/RD-Agent/"
|
||||
issue = "https://github.com/microsoft/RD-Agent/issues"
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
CLI entrance for all rdagent application.
|
||||
|
||||
This will
|
||||
- make rdagent a nice entry and
|
||||
- autoamtically load dotenv
|
||||
"""
|
||||
import fire
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from rdagent.app.data_mining.model import main as med_model
|
||||
from rdagent.app.general_model.general_model import (
|
||||
extract_models_and_implement as general_model,
|
||||
)
|
||||
from rdagent.app.qlib_rd_loop.factor import main as fin_factor
|
||||
from rdagent.app.qlib_rd_loop.factor_from_report import main as fin_factor_report
|
||||
from rdagent.app.qlib_rd_loop.model import main as fin_model
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
def app():
|
||||
fire.Fire(
|
||||
{
|
||||
"fin_factor": fin_factor,
|
||||
"fin_factor_report": fin_factor_report,
|
||||
"fin_model": fin_model,
|
||||
"med_model": med_model,
|
||||
"general_model": general_model,
|
||||
}
|
||||
)
|
||||
@@ -11,6 +11,8 @@ class ModelRDLoop(RDLoop):
|
||||
|
||||
def main(path=None, step_n=None):
|
||||
"""
|
||||
Auto R&D Evolving loop for models in a medical scenario.
|
||||
|
||||
You can continue running session by
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# %%
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from rdagent.scenarios.general_model.scenario import GeneralModelScenario
|
||||
@@ -17,11 +16,11 @@ from rdagent.log import rdagent_logger as logger
|
||||
from rdagent.scenarios.qlib.developer.model_coder import QlibModelCoSTEER
|
||||
|
||||
|
||||
def extract_models_and_implement(
|
||||
report_file_path: str,
|
||||
) -> None:
|
||||
def extract_models_and_implement(report_file_path: str) -> None:
|
||||
"""
|
||||
Extracts models from a given PDF report file and implements the necessary operations.
|
||||
This is a research copilot to automatically implement models from a report file or paper.
|
||||
|
||||
It extracts models from a given PDF report file and implements the necessary operations.
|
||||
|
||||
Parameters:
|
||||
report_file_path (str): The path to the report file. The file must be a PDF file.
|
||||
|
||||
@@ -27,11 +27,13 @@ class FactorRDLoop(RDLoop):
|
||||
|
||||
def main(path=None, step_n=None):
|
||||
"""
|
||||
Auto R&D Evolving loop for fintech factors.
|
||||
|
||||
You can continue running session by
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
dotenv run -- python rdagent/app/qlib_rd_loop/factor_w_sc.py $LOG_PATH/__session__/1/0_propose --step_n 1 # `step_n` is a optional paramter
|
||||
dotenv run -- python rdagent/app/qlib_rd_loop/factor.py $LOG_PATH/__session__/1/0_propose --step_n 1 # `step_n` is a optional paramter
|
||||
|
||||
"""
|
||||
if path is None:
|
||||
+4
-2
@@ -6,7 +6,7 @@ import fire
|
||||
from jinja2 import Environment, StrictUndefined
|
||||
|
||||
from rdagent.app.qlib_rd_loop.conf import FACTOR_FROM_REPORT_PROP_SETTING
|
||||
from rdagent.app.qlib_rd_loop.factor_w_sc import FactorRDLoop
|
||||
from rdagent.app.qlib_rd_loop.factor import FactorRDLoop
|
||||
from rdagent.components.document_reader.document_reader import (
|
||||
extract_first_page_screenshot_from_pdf,
|
||||
load_and_process_pdfs_by_langchain,
|
||||
@@ -142,11 +142,13 @@ class FactorReportLoop(FactorRDLoop, metaclass=LoopMeta):
|
||||
|
||||
def main(path=None, step_n=None):
|
||||
"""
|
||||
Auto R&D Evolving loop for fintech factors (the factors are extracted from finance report).
|
||||
|
||||
You can continue running session by
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
dotenv run -- python rdagent/app/qlib_rd_loop/factor_from_report_w_sc.py $LOG_PATH/__session__/1/0_propose --step_n 1 # `step_n` is a optional parameter
|
||||
dotenv run -- python rdagent/app/qlib_rd_loop/factor_from_report.py $LOG_PATH/__session__/1/0_propose --step_n 1 # `step_n` is a optional parameter
|
||||
|
||||
"""
|
||||
if path is None:
|
||||
@@ -15,11 +15,13 @@ class ModelRDLoop(RDLoop):
|
||||
|
||||
def main(path=None, step_n=None):
|
||||
"""
|
||||
Auto R&D Evolving loop for fintech models
|
||||
|
||||
You can continue running session by
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
dotenv run -- python rdagent/app/qlib_rd_loop/model_w_sc.py $LOG_PATH/__session__/1/0_propose --step_n 1 # `step_n` is a optional paramter
|
||||
dotenv run -- python rdagent/app/qlib_rd_loop/model.py $LOG_PATH/__session__/1/0_propose --step_n 1 # `step_n` is a optional paramter
|
||||
|
||||
"""
|
||||
if path is None:
|
||||
@@ -12,6 +12,7 @@ from jinja2 import Environment, StrictUndefined
|
||||
from sklearn.cluster import KMeans
|
||||
from sklearn.metrics.pairwise import cosine_similarity
|
||||
from sklearn.preprocessing import normalize
|
||||
from tqdm.auto import tqdm
|
||||
|
||||
from rdagent.components.document_reader.document_reader import (
|
||||
load_and_process_pdfs_by_langchain,
|
||||
@@ -62,7 +63,7 @@ def classify_report_from_dict(
|
||||
res_dict = {}
|
||||
classify_prompt = document_process_prompts["classify_system"]
|
||||
|
||||
for key, value in report_dict.items():
|
||||
for key, value in tqdm(report_dict.items()):
|
||||
if not key.endswith(".pdf"):
|
||||
continue
|
||||
file_name = key
|
||||
|
||||
Reference in New Issue
Block a user