31 lines
No EOL
1 KiB
PowerShell
31 lines
No EOL
1 KiB
PowerShell
# PowerShell script to run document extraction test
|
|
# Usage: .\run_document_test.ps1 [file_path]
|
|
|
|
param(
|
|
[string]$FilePath = "test_sample_document.txt"
|
|
)
|
|
|
|
Write-Host "=== PowerOn Document Extraction Test ===" -ForegroundColor Green
|
|
Write-Host ""
|
|
|
|
# Check if file exists
|
|
if (-not (Test-Path $FilePath)) {
|
|
Write-Host "Error: File not found: $FilePath" -ForegroundColor Red
|
|
Write-Host "Please provide a valid file path as parameter or ensure test_sample_document.txt exists." -ForegroundColor Yellow
|
|
exit 1
|
|
}
|
|
|
|
Write-Host "Testing document extraction for file: $FilePath" -ForegroundColor Cyan
|
|
Write-Host "Log file will be: test_document_extraction.log" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# Run the Python test
|
|
try {
|
|
python test_document_extraction.py $FilePath
|
|
Write-Host ""
|
|
Write-Host "Test completed successfully!" -ForegroundColor Green
|
|
Write-Host "Check test_document_extraction.log for detailed results." -ForegroundColor Cyan
|
|
} catch {
|
|
Write-Host "Test failed with error: $($_.Exception.Message)" -ForegroundColor Red
|
|
exit 1
|
|
} |