Ejemplo n.º 1
0
def reco_quali(phrase_test): #tagg known qualitativ
    quali_reco = []
    for j in range(1,5):
        words = generate_ngrams(phrase_test, j)
        words = racinisation(words)
        for word in words:
            for i in range(0,len(qualif)):
                if word == qualif[i].replace('é','e'):
                    quali_reco.append(quali[i])
                    mots_reconu.append(word)
    quali_reco = filtrage_solution(quali_reco)
    return quali_reco
Ejemplo n.º 2
0
def reco_concept(phrase_test): #tagg known troubles
    concept_reco =[]
    for j in range(1,5):
        words = generate_ngrams(phrase_test, j)
        words = racinisation(words)
        for word in words:
            for i in range(0,len(concepts)):
                if word == concepts[i][0]:
                    concept_reco.append(concepts[i][1])
                    mots_reconu.append(word)
    concept_reco = filtrage_solution(concept_reco)
    return concept_reco
Ejemplo n.º 3
0
def reco_nega(neg,phrase_test):  #tagg negation marker
    neg_reco =[]
    for j in range(1,5):
        words = generate_ngrams(phrase_test, j)
        words = racinisation(words)
        for word in words:
            for i in range(0,len(neg)):
                if word == neg[i]:
                    neg_reco.append(neg[i])
                    mot_neg.append(word)
    neg_reco = filtrage_solution(neg_reco)
    neg_reco = set(neg_reco)
    return neg_reco
Ejemplo n.º 4
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun  4 10:15:28 2019

@author: oni
"""

from lemmat import tagger, generate_ngrams, racinisation
from treatment_file import treat_line
from tagg_concepts import mots_reconu, filtrage_solution

s = 'rythme sinusal permanent pas de troubles rythmiques pas d episodes de bradycardie cardiaque significative extrasystolie ventriculaire charge autour de 7.5% pas de pauses cardiaques significatives'
new_s = ''

words = generate_ngrams(s, 1)
temp = tagger(words)
tag = temp[0]
for i in range(0, len(tag)):
    if tag[i][1] == 'ADJ' or tag[i][1] == 'NC':
        new_s = new_s + tag[i][0] + ' '

print(new_s)
treat_line(new_s)

mots = []
for i in range(1, 5):
    temp = generate_ngrams(new_s, i)
    mots = mots + racinisation(temp)
result = []
reco = mots_reconu