لم يعد هذا المستودع يتم الحفاظ عليه
textpipe هي حزمة Python لتحويل النص الخام إلى تنظيف النص القابل للقراءة واستخراج البيانات الوصفية من هذا النص. تتضمن وظائفها تحويل النص الخام إلى نص قابل للقراءة عن طريق إزالة علامات HTML واستخراج البيانات الوصفية مثل عدد الكلمات والكيانات المسماة من النص.
HTML وغيرها من بنيات غير قابلة للقراءةيوصى بتثبيت TextPipe باستخدام بيئة افتراضية.
أولاً ، قم بإنشاء بيئتك الافتراضية باستخدام VirtualEnv أو VirtualEnvwrapper.
باستخدام VenV إذا كان المترجم الافتراضي الخاص بك هو Python3.6
python3 -m venv .venvvirtualenv venv -p python3.6mkvirtualenv textpipe -p python3.6pip install textpipepip install -r requirements.txtعلى الرغم من أن ملف المتطلبات. انظر صفحة spacy.io على نماذجها المختلفة لمزيد من المعلومات.
> >> from textpipe import doc , pipeline
> >> sample_text = 'Sample text! <!DOCTYPE>'
> >> document = doc . Doc ( sample_text )
> >> print ( document . clean )
'Sample text!'
> >> print ( document . language )
'en'
> >> print ( document . nwords )
2
> >> pipe = pipeline . Pipeline ([ 'CleanText' , 'NWords' ])
> >> print ( pipe ( sample_text ))
{ 'CleanText' : 'Sample text!' , 'NWords' : 3 }من أجل تمديد عمليات TextPipe الحالية مع عمليات الملكية الخاصة بك ؛
test_pipe = pipeline . Pipeline ([ 'CleanText' , 'NWords' ])
def custom_op ( doc , context = None , settings = None , ** kwargs ):
return 1
custom_argument = { 'argument' : 1 }
test_pipe . register_operation ( 'CUSTOM_STEP' , custom_op )
test_pipe . steps . append (( 'CUSTOM_STEP' , custom_argument ))انظر المساهمة للحصول على إرشادات للمساهمين.
0.12.1
0.12.0
0.11.9
ents التعسفية0.11.8
cats0.11.7
0.11.6
0.11.5
0.11.4
0.11.1
0.11.0
0.9.0
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.2
0.7.0
context KWARGregister_operation في خط الأنابيب