You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your project, it is very nice!
But I tried to parse the news using Ollama, and the project could not meet my needs properly.
This my code:
import os
import asyncio
from crawl4ai import AsyncWebCrawler, CacheMode
from crawl4ai.extraction_strategy import LLMExtractionStrategy
from pydantic import BaseModel, Field
class KnowledgeGraph(BaseModel):
title: str
content: str
async def main(url):
async with AsyncWebCrawler(
verbose=True,
user_agent_mode="random",
user_agent_generator_config={
"device_type": "mobile",
"os_type": "android"
},
) as crawler:
result = await crawler.arun(
url=url,
cache_mode=CacheMode.BYPASS,
remove_overlay_elements=True,
word_count_threshold=1,
extraction_strategy=LLMExtractionStrategy(
provider="ollama/qwen2.5:14b",
schema=KnowledgeGraph.schema(),
extraction_type="schema",
instruction="""Extract title and content from the given text.
"""
),
bypass_cache=True,
)
print(result.extracted_content)
Thank you for your project, it is very nice!
But I tried to parse the news using Ollama, and the project could not meet my needs properly.
This my code:
import os
import asyncio
from crawl4ai import AsyncWebCrawler, CacheMode
from crawl4ai.extraction_strategy import LLMExtractionStrategy
from pydantic import BaseModel, Field
class KnowledgeGraph(BaseModel):
title: str
content: str
async def main(url):
async with AsyncWebCrawler(
verbose=True,
user_agent_mode="random",
user_agent_generator_config={
"device_type": "mobile",
"os_type": "android"
},
) as crawler:
result = await crawler.arun(
url=url,
cache_mode=CacheMode.BYPASS,
remove_overlay_elements=True,
word_count_threshold=1,
extraction_strategy=LLMExtractionStrategy(
if name == "main":
The text was updated successfully, but these errors were encountered: