mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-06 21:11:37 +08:00
Merge pull request #469 from Kernick/add-openai-supported-model-gpt-4o-mini
Add openai supported model gpt 4o mini
This commit is contained in:
commit
ca453daabe
32
CHANGELOG.md
32
CHANGELOG.md
@ -1,37 +1,5 @@
|
||||
## [1.9.0-beta.6](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.9.0-beta.5...v1.9.0-beta.6) (2024-07-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* refactoring_to_md function ([602dd00](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/602dd00209ee1d72a1223fc4793759450921fcf9))
|
||||
|
||||
## [1.9.0-beta.5](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.9.0-beta.4...v1.9.0-beta.5) (2024-07-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* search link node ([cf3ab55](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/cf3ab5564ae5c415c63d1771b32ea68f5169ca82))
|
||||
|
||||
## [1.9.0-beta.4](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.9.0-beta.3...v1.9.0-beta.4) (2024-07-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add searchngx integration ([5c92186](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/5c9218608140bf694fbfd96aa90276bc438bb475))
|
||||
|
||||
|
||||
### chore
|
||||
|
||||
* correct search engine name ([7ba2f6a](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/7ba2f6ae0b9d2e9336e973e1f57ab8355c739e27))
|
||||
* remove unused import ([fd1b7cb](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/fd1b7cb24a7c252277607abde35826e3c58e34ef))
|
||||
|
||||
## [1.9.0-beta.3](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.9.0-beta.2...v1.9.0-beta.3) (2024-07-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* solve a burr integration ([881290b](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/881290b5066b39c505532656671fbf65f8fc312c))
|
||||
|
||||
## [1.9.0-beta.2](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.9.0-beta.1...v1.9.0-beta.2) (2024-07-05)
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
# 🕷️ ScrapeGraphAI: You Only Scrape Once
|
||||
[English](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/README.md) | [中文](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/docs/chinese.md) | [日本語](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/docs/japanese.md)
|
||||
| [코리아노](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/docs/korean.md)
|
||||
| [한국어](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/docs/korean.md)
|
||||
| [Русский](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/docs/russian.md)
|
||||
|
||||
|
||||
|
||||
137
docs/korean.md
137
docs/korean.md
@ -1,7 +1,7 @@
|
||||
# 🕷️ ScrapeGraphAI: 한 번만 스크래핑하세요
|
||||
# 🕷️ ScrapeGraphAI: 한 방에 끝내는 웹스크래핑
|
||||
|
||||
|
||||
ScrapeGraphAI는 웹 사이트와 로컬 문서(XML, HTML, JSON 등)에 대한 스크래핑 파이프라인을 만들기 위해 LLM 및 직접 그래프 로직을 사용하는 파이썬 웹 스크래핑 라이브러리입니다.
|
||||
ScrapeGraphAI는 웹 사이트와 로컬 문서(XML, HTML, JSON 등)에 대한 스크래핑 파이프라인을 만들기 위해 LLM 및 직접 그래프 로직을 사용하는 파이썬 웹스크래핑 라이브러리입니다.
|
||||
|
||||
추출하려는 정보를 말하기만 하면 라이브러리가 알아서 처리해 줍니다!
|
||||
|
||||
@ -11,41 +11,46 @@ ScrapeGraphAI는 웹 사이트와 로컬 문서(XML, HTML, JSON 등)에 대한
|
||||
|
||||
## 🚀 빠른 설치
|
||||
|
||||
Scrapegraph-ai에 대한 참조 페이지는 PyPI의 공식 페이지에서 확인할 수 있습니다: pypi.
|
||||
Scrapegraph-ai에 대한 참조 페이지는 PyPI의 공식 페이지에서 확인할 수 있습니다: [pypi](https://pypi.org/project/scrapegraphai/).
|
||||
|
||||
bash
|
||||
Copia codice
|
||||
```bash
|
||||
pip install scrapegraphai
|
||||
```
|
||||
참고: 다른 라이브러리와의 충돌을 피하기 위해 라이브러리를 가상 환경에 설치하는 것이 좋습니다 🐱
|
||||
|
||||
## 🔍 데모
|
||||
|
||||
공식 Streamlit 데모:
|
||||
|
||||
[](https://scrapegraph-ai-web-dashboard.streamlit.app)
|
||||
|
||||
|
||||
Google Colab을 사용하여 웹에서 직접 사용해 보세요:
|
||||
|
||||
[](https://colab.research.google.com/drive/1sEZBonBMGP44CtO6GQTwAlL0BGJXjtfd?usp=sharing)
|
||||
|
||||
|
||||
## 📖 문서
|
||||
|
||||
ScrapeGraphAI에 대한 문서는 여기에서 찾을 수 있습니다.
|
||||
ScrapeGraphAI에 대한 문서는 [여기](https://scrapegraph-ai.readthedocs.io/en/latest/)에서 찾을 수 있습니다.
|
||||
|
||||
또한 Docusaurus를 여기에서 확인해 보세요.
|
||||
또한 Docusaurus를 [여기](https://scrapegraph-doc.onrender.com/)에서 확인해 보세요.
|
||||
|
||||
## 💻 사용법
|
||||
|
||||
웹 사이트(또는 로컬 파일)에서 정보를 추출하는 데 사용할 수 있는 세 가지 주요 스크래핑 파이프라인이 있습니다:
|
||||
웹사이트(또는 로컬 파일)에서 정보를 추출하기 위해 사용할 수 있는 여러 표준 스크래핑 파이프라인이 있습니다:
|
||||
- `SmartScraperGraph`: 사용자 프롬프트와 입력 소스만 필요로 하는 단일 페이지 스크래퍼입니다.
|
||||
- `SearchGraph`: 검색 엔진의 상위 n개 검색 결과에서 정보를 추출하는 다중 페이지 스크래퍼입니다.
|
||||
- `SpeechGraph`: 웹사이트에서 정보를 추출하고 오디오 파일을 생성하는 단일 페이지 스크래퍼입니다.
|
||||
- `ScriptCreatorGraph`: 웹사이트에서 정보를 추출하고 Python 스크립트를 생성하는 단일 페이지 스크래퍼입니다.
|
||||
|
||||
SmartScraperGraph: 사용자 프롬프트와 입력 소스만 필요한 단일 페이지 스크래퍼;
|
||||
SearchGraph: 검색 엔진의 상위 n개의 검색 결과에서 정보를 추출하는 다중 페이지 스크래퍼;
|
||||
SpeechGraph: 웹 사이트에서 정보를 추출하고 오디오 파일을 생성하는 단일 페이지 스크래퍼.
|
||||
SmartScraperMultiGraph: 단일 프롬프트를 사용하여 여러 페이지를 스크래핑하는 스크래퍼
|
||||
OpenAI, Groq, Azure, Gemini와 같은 API를 통해 다양한 LLM을 사용할 수 있으며, Ollama를 사용하여 로컬 모델을 사용할 수도 있습니다.
|
||||
- `SmartScraperMultiGraph`: 단일 프롬프트와 소스 목록을 사용하여 여러 페이지에서 정보를 추출하는 다중 페이지 스크래퍼입니다.
|
||||
- `ScriptCreatorMultiGraph`: 단일 프롬프트와 소스 목록을 사용하여 여러 페이지에서 정보를 추출하는 Python 스크립트를 생성하는 다중 페이지 스크래퍼입니다.
|
||||
|
||||
사례 1: 로컬 모델을 사용하는 SmartScraper
|
||||
Ollama를 설치하고 ollama pull 명령을 사용하여 모델을 다운로드하세요.
|
||||
**OpenAI**, **Groq**, **Azure**, **Gemini**와 같은 API를 통해 다양한 LLM을 사용할 수 있으며, **Ollama**를 사용하여 로컬 모델도 사용할 수 있습니다.
|
||||
|
||||
### 사례 1: 로컬 모델을 사용하는 SmartScraper
|
||||
[Ollama](https://ollama.com/)를 설치하고 **ollama pull** 명령을 사용하여 모델을 다운로드하세요.
|
||||
|
||||
```python
|
||||
from scrapegraphai.graphs import SmartScraperGraph
|
||||
@ -54,19 +59,19 @@ graph_config = {
|
||||
"llm": {
|
||||
"model": "ollama/mistral",
|
||||
"temperature": 0,
|
||||
"format": "json", # Ollama는 형식을 명시적으로 지정해야 합니다
|
||||
"base_url": "http://localhost:11434", # Ollama URL 설정
|
||||
"format": "json", # Ollama needs the format to be specified explicitly
|
||||
"base_url": "http://localhost:11434", # set Ollama URL
|
||||
},
|
||||
"embeddings": {
|
||||
"model": "ollama/nomic-embed-text",
|
||||
"base_url": "http://localhost:11434", # Ollama URL 설정
|
||||
"base_url": "http://localhost:11434", # set Ollama URL
|
||||
},
|
||||
"verbose": True,
|
||||
}
|
||||
|
||||
smart_scraper_graph = SmartScraperGraph(
|
||||
prompt="프로젝트와 설명을 모두 나열하세요",
|
||||
# 이미 다운로드된 HTML 코드가 있는 문자열도 허용
|
||||
prompt="List me all the projects with their descriptions",
|
||||
# also accepts a string with the already downloaded HTML code
|
||||
source="https://perinim.github.io/projects",
|
||||
config=graph_config
|
||||
)
|
||||
@ -78,15 +83,16 @@ print(result)
|
||||
출력은 다음과 같이 프로젝트와 설명의 목록이 될 것입니다:
|
||||
|
||||
```python
|
||||
{'projects': [{'title': 'Rotary Pendulum RL', 'description': 'RL 알고리즘을 사용하여 실제 회전 진자를 제어하는 오픈 소스 프로젝트'}, {'title': 'DQN Implementation from scratch', 'description': '간단한 및 이중 진자를 훈련하기 위한 딥 Q-네트워크 알고리즘 개발'}, ...]}
|
||||
사례 2: 혼합 모델을 사용하는 SearchGraph
|
||||
우리는 LLM에 Groq를 사용하고, 임베딩에 Ollama를 사용합니다.
|
||||
{'projects': [{'title': 'Rotary Pendulum RL', 'description': 'Open Source project aimed at controlling a real life rotary pendulum using RL algorithms'}, {'title': 'DQN Implementation from scratch', 'description': 'Developed a Deep Q-Network algorithm to train a simple and double pendulum'}, ...]}
|
||||
```
|
||||
|
||||
### 사례 2: 혼합 모델을 사용하는 SearchGraph
|
||||
우리는 LLM에 **Groq**를 사용하고, 임베딩에 **Ollama**를 사용합니다.
|
||||
|
||||
```python
|
||||
from scrapegraphai.graphs import SearchGraph
|
||||
|
||||
# 그래프 구성 정의
|
||||
# Define the configuration for the graph
|
||||
graph_config = {
|
||||
"llm": {
|
||||
"model": "groq/gemma-7b-it",
|
||||
@ -95,28 +101,30 @@ graph_config = {
|
||||
},
|
||||
"embeddings": {
|
||||
"model": "ollama/nomic-embed-text",
|
||||
"base_url": "http://localhost:11434", # Ollama URL 임의 설정
|
||||
"base_url": "http://localhost:11434", # set ollama URL arbitrarily
|
||||
},
|
||||
"max_results": 5,
|
||||
}
|
||||
|
||||
# SearchGraph 인스턴스 생성
|
||||
# Create the SearchGraph instance
|
||||
search_graph = SearchGraph(
|
||||
prompt="Chioggia의 전통 레시피를 모두 나열하세요",
|
||||
prompt="List me all the traditional recipes from Chioggia",
|
||||
config=graph_config
|
||||
)
|
||||
|
||||
# 그래프 실행
|
||||
# Run the graph
|
||||
result = search_graph.run()
|
||||
print(result)
|
||||
출력은 다음과 같이 레시피 목록이 될 것입니다:
|
||||
```
|
||||
|
||||
출력은 다음과 같이 레시피 목록이 될 것입니다:
|
||||
|
||||
```python
|
||||
{'recipes': [{'name': 'Sarde in Saòre'}, {'name': 'Bigoli in salsa'}, {'name': 'Seppie in umido'}, {'name': 'Moleche frite'}, {'name': 'Risotto alla pescatora'}, {'name': 'Broeto'}, {'name': 'Bibarasse in Cassopipa'}, {'name': 'Risi e bisi'}, {'name': 'Smegiassa Ciosota'}]}
|
||||
사례 3: OpenAI를 사용하는 SpeechGraph
|
||||
OpenAI API 키와 모델 이름만 전달하면 됩니다.
|
||||
```
|
||||
### 사례 3: OpenAI를 사용하는 SpeechGraph
|
||||
|
||||
OpenAI API 키와 모델 이름만 전달하면 됩니다.
|
||||
|
||||
```python
|
||||
from scrapegraphai.graphs import SpeechGraph
|
||||
@ -135,22 +143,23 @@ graph_config = {
|
||||
}
|
||||
|
||||
# ************************************************
|
||||
# SpeechGraph 인스턴스를 생성하고 실행합니다.
|
||||
# Create the SpeechGraph instance and run it
|
||||
# ************************************************
|
||||
|
||||
speech_graph = SpeechGraph(
|
||||
prompt="프로젝트에 대한 자세한 오디오 요약을 만드세요.",
|
||||
prompt="Make a detailed audio summary of the projects.",
|
||||
source="https://perinim.github.io/projects/",
|
||||
config=graph_config,
|
||||
)
|
||||
|
||||
result = speech_graph.run()
|
||||
print(result)
|
||||
|
||||
```
|
||||
|
||||
출력은 페이지의 프로젝트 요약이 포함된 오디오 파일이 될 것입니다.
|
||||
|
||||
후원사
|
||||
## 스폰
|
||||
|
||||
<div style="text-align: center;">
|
||||
<a href="https://serpapi.com?utm_source=scrapegraphai">
|
||||
@ -165,46 +174,68 @@ print(result)
|
||||
|
||||
기여를 환영하며, 개선 사항을 논의하고 제안 사항을 주고받기 위해 우리의 Discord 서버에 참여하세요!
|
||||
|
||||
기여 가이드라인을 참조하십시오.
|
||||
기여 가이드라인을 참고해주세요: [contributing guidelines](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/CONTRIBUTING.md).
|
||||
|
||||
## 📈 로드맵
|
||||
|
||||
프로젝트 로드맵을 여기에서 확인하세요! 🚀
|
||||
다음 기능들을 작업하고 있습니다! 협업에 관심이 있으시면 해당 기능을 마우스 오른쪽 버튼으로 클릭하여 새 탭에서 PR을 작성해주세요. 의문사항이 있거나 논의하고 싶다면 [Discord](https://discord.gg/uJN7TYcpNa)에서 저희에게 연락하거나 Github의 [Discussion](https://github.com/VinciGit00/Scrapegraph-ai/discussions) 페이지를 열어주세요!
|
||||
|
||||
로드맵을 더 인터랙티브하게 시각화하고 싶으신가요? markdown 내용을 편집기에 복사하여 markmap 시각화를 확인하세요!
|
||||
```mermaid
|
||||
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#5C4B9B', 'edgeLabelBackground':'#ffffff', 'tertiaryColor': '#ffffff', 'primaryBorderColor': '#5C4B9B', 'fontFamily': 'Arial', 'fontSize': '16px', 'textColor': '#5C4B9B' }}}%%
|
||||
graph LR
|
||||
A[DeepSearch Graph] --> F[Use Existing Chromium Instances]
|
||||
F --> B[Page Caching]
|
||||
B --> C[Screenshot Scraping]
|
||||
C --> D[Handle Dynamic Content]
|
||||
D --> E[New Webdrivers]
|
||||
|
||||
style A fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10
|
||||
style F fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10
|
||||
style B fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10
|
||||
style C fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10
|
||||
style D fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10
|
||||
style E fill:#ffffff,stroke:#5C4B9B,stroke-width:2px,rx:10,ry:10
|
||||
|
||||
click A href "https://github.com/VinciGit00/Scrapegraph-ai/issues/260" "Open DeepSearch Graph Issue"
|
||||
click F href "https://github.com/VinciGit00/Scrapegraph-ai/issues/329" "Open Chromium Instances Issue"
|
||||
click B href "https://github.com/VinciGit00/Scrapegraph-ai/issues/197" "Open Page Caching Issue"
|
||||
click C href "https://github.com/VinciGit00/Scrapegraph-ai/issues/197" "Open Screenshot Scraping Issue"
|
||||
click D href "https://github.com/VinciGit00/Scrapegraph-ai/issues/279" "Open Handle Dynamic Content Issue"
|
||||
click E href "https://github.com/VinciGit00/Scrapegraph-ai/issues/171" "Open New Webdrivers Issue"
|
||||
```
|
||||
|
||||
## ️ 기여자들
|
||||
|
||||
|
||||
[](https://github.com/VinciGit00/Scrapegraph-ai/graphs/contributors)
|
||||
|
||||
## 🎓 인용
|
||||
|
||||
우리의 라이브러리를 연구 목적으로 사용한 경우 다음과 같이 인용해 주세요:
|
||||
|
||||
text
|
||||
Copia codice
|
||||
```text
|
||||
@misc{scrapegraph-ai,
|
||||
author = {Marco Perini, Lorenzo Padoan, Marco Vinciguerra},
|
||||
title = {Scrapegraph-ai},
|
||||
year = {2024},
|
||||
url = {https://github.com/VinciGit00/Scrapegraph-ai},
|
||||
note = {대규모 언어 모델을 활용한 Python 스크레이핑 라이브러리}
|
||||
note = {A Python library for scraping leveraging large language models}
|
||||
}
|
||||
저자들
|
||||
```
|
||||
|
||||
## 저자들
|
||||
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/VinciGit00/Scrapegraph-ai/main/docs/assets/logo_authors.png" alt="Authors_logos">
|
||||
</p>
|
||||
연락처
|
||||
Marco Vinciguerra
|
||||
Marco Perini
|
||||
Lorenzo Padoan
|
||||
|
||||
| | 연락처 |
|
||||
|--------------------|---------------|
|
||||
| Marco Vinciguerra | [](https://www.linkedin.com/in/marco-vinciguerra-7ba365242/) |
|
||||
| Marco Perini | [](https://www.linkedin.com/in/perinim/) |
|
||||
| Lorenzo Padoan | [](https://www.linkedin.com/in/lorenzo-padoan-4521a2154/) |
|
||||
|
||||
## 📜 라이선스
|
||||
|
||||
ScrapeGraphAI는 MIT License로 라이선스가 부여되었습니다. 자세한 내용은 LICENSE 파일을 참조하세요.
|
||||
ScrapeGraphAI는 MIT License로 배포되었습니. 자세한 내용은 [LICENSE](https://github.com/VinciGit00/Scrapegraph-ai/blob/main/LICENSE) 파일을 참조하세요.
|
||||
|
||||
감사의 말
|
||||
## 감사의 말
|
||||
|
||||
프로젝트에 기여한 모든 분들과 오픈 소스 커뮤니티에 감사드립니다.
|
||||
ScrapeGraphAI는 데이터 탐색 및 연구 목적으로만 사용되어야 합니다. 우리는 라이브러리의 오용에 대해 책임을 지지 않습니다.
|
||||
- 프로젝트에 기여한 모든 분들과 오픈 소스 커뮤니티에 감사드립니다.
|
||||
- ScrapeGraphAI는 데이터 탐색 및 연구 목적으로만 사용되어야 합니다. 우리는 라이브러리의 오용에 대해 책임을 지지 않습니다.
|
||||
|
||||
@ -9,7 +9,7 @@ from scrapegraphai.nodes import FetchNode
|
||||
# ************************************************
|
||||
|
||||
|
||||
robots_node = FetchNode(
|
||||
fetch_node = FetchNode(
|
||||
input="url | local_dir",
|
||||
output=["doc"],
|
||||
node_config={
|
||||
@ -25,6 +25,6 @@ state = {
|
||||
"url": "https://twitter.com/home"
|
||||
}
|
||||
|
||||
result = robots_node.execute(state)
|
||||
result = fetch_node.execute(state)
|
||||
|
||||
print(result)
|
||||
|
||||
@ -2,9 +2,11 @@
|
||||
name = "scrapegraphai"
|
||||
|
||||
|
||||
|
||||
version = "1.9.0b6"
|
||||
|
||||
|
||||
|
||||
description = "A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines."
|
||||
authors = [
|
||||
{ name = "Marco Vinciguerra", email = "mvincig11@gmail.com" },
|
||||
|
||||
@ -16,6 +16,7 @@ models_tokens = {
|
||||
"gpt-4-32k": 32768,
|
||||
"gpt-4-32k-0613": 32768,
|
||||
"gpt-4o": 128000,
|
||||
"gpt-4o-mini":128000,
|
||||
},
|
||||
"azure": {
|
||||
"gpt-3.5-turbo": 4096,
|
||||
|
||||
@ -102,7 +102,7 @@ class BurrBridge:
|
||||
def __init__(self, base_graph, burr_config):
|
||||
self.base_graph = base_graph
|
||||
self.burr_config = burr_config
|
||||
self.project_name = burr_config.get("project_name", "scrapegraph: {}")
|
||||
self.project_name = burr_config.get("project_name", "scrapegraph_project")
|
||||
self.app_instance_id = burr_config.get("app_instance_id", "default-instance")
|
||||
self.burr_inputs = burr_config.get("inputs", {})
|
||||
self.burr_app = None
|
||||
|
||||
Loading…
Reference in New Issue
Block a user