diff --git a/README.md b/README.md index 488c8ed6..560246c4 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/korean.md b/docs/korean.md index 40c88e06..7ea1e57e 100644 --- a/docs/korean.md +++ b/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 ์คํฌ๋ฆฝํธ๋ฅผ ์์ฑํ๋ ๋จ์ผ ํ์ด์ง ์คํฌ๋ํผ์ ๋๋ค. + +- `SmartScraperMultiGraph`: ๋จ์ผ ํ๋กฌํํธ์ ์์ค ๋ชฉ๋ก์ ์ฌ์ฉํ์ฌ ์ฌ๋ฌ ํ์ด์ง์์ ์ ๋ณด๋ฅผ ์ถ์ถํ๋ ๋ค์ค ํ์ด์ง ์คํฌ๋ํผ์ ๋๋ค. +- `ScriptCreatorMultiGraph`: ๋จ์ผ ํ๋กฌํํธ์ ์์ค ๋ชฉ๋ก์ ์ฌ์ฉํ์ฌ ์ฌ๋ฌ ํ์ด์ง์์ ์ ๋ณด๋ฅผ ์ถ์ถํ๋ Python ์คํฌ๋ฆฝํธ๋ฅผ ์์ฑํ๋ ๋ค์ค ํ์ด์ง ์คํฌ๋ํผ์ ๋๋ค. -SmartScraperGraph: ์ฌ์ฉ์ ํ๋กฌํํธ์ ์ ๋ ฅ ์์ค๋ง ํ์ํ ๋จ์ผ ํ์ด์ง ์คํฌ๋ํผ; -SearchGraph: ๊ฒ์ ์์ง์ ์์ n๊ฐ์ ๊ฒ์ ๊ฒฐ๊ณผ์์ ์ ๋ณด๋ฅผ ์ถ์ถํ๋ ๋ค์ค ํ์ด์ง ์คํฌ๋ํผ; -SpeechGraph: ์น ์ฌ์ดํธ์์ ์ ๋ณด๋ฅผ ์ถ์ถํ๊ณ ์ค๋์ค ํ์ผ์ ์์ฑํ๋ ๋จ์ผ ํ์ด์ง ์คํฌ๋ํผ. -SmartScraperMultiGraph: ๋จ์ผ ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํ์ฌ ์ฌ๋ฌ ํ์ด์ง๋ฅผ ์คํฌ๋ํํ๋ ์คํฌ๋ํผ -OpenAI, Groq, Azure, Gemini์ ๊ฐ์ API๋ฅผ ํตํด ๋ค์ํ LLM์ ์ฌ์ฉํ ์ ์์ผ๋ฉฐ, Ollama๋ฅผ ์ฌ์ฉํ์ฌ ๋ก์ปฌ ๋ชจ๋ธ์ ์ฌ์ฉํ ์๋ ์์ต๋๋ค. +**OpenAI**, **Groq**, **Azure**, **Gemini**์ ๊ฐ์ API๋ฅผ ํตํด ๋ค์ํ LLM์ ์ฌ์ฉํ ์ ์์ผ๋ฉฐ, **Ollama**๋ฅผ ์ฌ์ฉํ์ฌ ๋ก์ปฌ ๋ชจ๋ธ๋ ์ฌ์ฉํ ์ ์์ต๋๋ค. -์ฌ๋ก 1: ๋ก์ปฌ ๋ชจ๋ธ์ ์ฌ์ฉํ๋ SmartScraper -Ollama๋ฅผ ์ค์นํ๊ณ ollama pull ๋ช ๋ น์ ์ฌ์ฉํ์ฌ ๋ชจ๋ธ์ ๋ค์ด๋ก๋ํ์ธ์. +### ์ฌ๋ก 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) + ``` ์ถ๋ ฅ์ ํ์ด์ง์ ํ๋ก์ ํธ ์์ฝ์ด ํฌํจ๋ ์ค๋์ค ํ์ผ์ด ๋ ๊ฒ์ ๋๋ค. -ํ์์ฌ +## ์คํฐ