Exemplo n.º 1
0
def hasIntensifierFeature(procTxt, hr, featureVals = {}):
    featureVals = hasIntensifier(procTxt, hr, featureVals)
    intense_value = featureVals['hasIntensifier']
    featureSets = {}
    intensifierdict ={}
    intensifierdict.update(discVar2Feature(intense_value, 'hasIntensifier', lims = [1,1],collapse = [False, True]))
    featureSets.update(intensifierdict)
    return (featureVals, featureSets)
def hasIntensifierFeature(procTxt, hr, featureVals = {}):
    featureVals = hasIntensifier(procTxt, hr, featureVals)
    intense_value = featureVals['hasIntensifier']
    featureSets = {}
    intensifierdict ={}
    intensifierdict.update(discVar2Feature(intense_value, 'hasIntensifier', lims = [1,1],collapse = [False, True]))
    featureSets.update(intensifierdict)
    return (featureVals, featureSets)
Exemplo n.º 3
0
def countSmileyFeature(tokTag, hr, featureVals = {}):
    """
    count Smiley Feature Encoding
    3 level discretization for
    """
    csname = 'countSmiley'
    nsname = 'negative smiley'
    psname = 'positive smiley'

    featureVals = countSmiley(tokTag, hr, featureVals)
    np, nn = featureVals[csname]
    nfdict = discVar2Feature(featureVals[csname][0], nsname, lims = [1,1]) #negative smiley
    pfdict = discVar2Feature(featureVals[csname][1], psname, lims = [1,1]) #positive smiley
    featureSets = {}
    featureSets.update(pfdict.items())
    featureSets.update(nfdict.items())

    return (featureVals, featureSets)
def countSmileyFeature(tokTag, hr, featureVals = {}):
    """
    count Smiley Feature Encoding
    3 level discretization for
    """
    csname = 'countSmiley'
    nsname = 'negative smiley'
    psname = 'positive smiley'

    featureVals = countSmiley(tokTag, hr, featureVals)
    np, nn = featureVals[csname]
    nfdict = discVar2Feature(featureVals[csname][0], nsname, lims = [1,1]) #negative smiley
    pfdict = discVar2Feature(featureVals[csname][1], psname, lims = [1,1]) #positive smiley
    featureSets = {}
    featureSets.update(pfdict.items())
    featureSets.update(nfdict.items())

    return (featureVals, featureSets)
Exemplo n.º 5
0
def multiverb_sentFeature(tokTag, hr, featureVals = {}):
    featureVals = multiverb_sent(tokTag, hr, featureVals)
    fv = featureVals['multiverb_sent']
    retval = {}
    retval.update(discVar2Feature(fv, 'multiverbsentences', lims = [1,1], collapse = [False, True]))
    #retval['multiverb_sent'] = fv

    featureSets = {}
    featureSets.update(retval)
    return (featureVals, featureSets)
def multiverb_sentFeature(tokTag, hr, featureVals = {}):
    featureVals = multiverb_sent(tokTag, hr, featureVals)
    fv = featureVals['multiverb_sent']
    retval = {}
    retval.update(discVar2Feature(fv, 'multiverbsentences', lims = [1,1], collapse = [False, True]))
    #retval['multiverb_sent'] = fv

    featureSets = {}
    featureSets.update(retval)
    return (featureVals, featureSets)
Exemplo n.º 7
0
def countPosteriorPolarChunksFeature(procTxt, hr, featureVals = {}):
    featureVals = countPosteriorPolarChunks(procTxt, hr, featureVals)
    cnt = featureVals['countPosteriorPolarChunks']

    retdict = dict()
    for key, val in cnt.iteritems():
        retdict.update(discVar2Feature(val, key, lims = [1,3], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict)
    return (featureVals, featureSets)
def netPosteriorPolarChunksFeature(procTxt, hr, featureVals = {}):
    featureVals = netPosteriorPolarChunks(procTxt, hr, featureVals)
    cnt = featureVals['netPosteriorPolarChunks']

    #print cnt
    retdict = dict()
    retdict.update(discVar2Feature(cnt, 'netPosteriorPolarChunks', lims = [-1,3], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict) #{'NPP':cnt})
    return (featureVals, featureSets)
def countPosteriorPolarChunksFeature(procTxt, hr, featureVals = {}):
    featureVals = countPosteriorPolarChunks(procTxt, hr, featureVals)
    cnt = featureVals['countPosteriorPolarChunks']

    retdict = dict()
    for key, val in cnt.iteritems():
        retdict.update(discVar2Feature(val, key, lims = [1,3], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict)
    return (featureVals, featureSets)
Exemplo n.º 10
0
def netPosteriorPolarChunksFeature(procTxt, hr, featureVals = {}):
    featureVals = netPosteriorPolarChunks(procTxt, hr, featureVals)
    cnt = featureVals['netPosteriorPolarChunks']

    #print cnt
    retdict = dict()
    retdict.update(discVar2Feature(cnt, 'netPosteriorPolarChunks', lims = [-1,3], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict) #{'NPP':cnt})
    return (featureVals, featureSets)
Exemplo n.º 11
0
def countPolarChunksFeature(procTxt, hr, featureVals = {}):
    featureVals = countPolarChunks(procTxt, hr, featureVals)
    cnt = featureVals['countPolarChunks']

    retdict = dict()
    for chtype in TPC_CHUNKTYPES:
        for pol in TPC_POLTYPES:
            key = chtype+pol
            retdict.update(discVar2Feature(cnt[key], key, lims = [1,3], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict)
    return (featureVals, featureSets)
Exemplo n.º 12
0
def countPolarChunksFeature(procTxt, hr, featureVals = {}):
    featureVals = countPolarChunks(procTxt, hr, featureVals)
    cnt = featureVals['countPolarChunks']

    retdict = dict()
    for chtype in TPC_CHUNKTYPES:
        for pol in TPC_POLTYPES:
            key = chtype+pol
            retdict.update(discVar2Feature(cnt[key], key, lims = [1,3], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict)
    return (featureVals, featureSets)
Exemplo n.º 13
0
def netPolarChunksFeature(procTxt, hr, featureVals = {}):
    featureVals = netPolarChunks(procTxt, hr, featureVals)
    cnt = featureVals['netPolarChunks']

    #print cnt
    retdict = dict()
    retdict.update(discVar2Feature(cnt, 'netPolarChunks', lims = [-1,1], collapse = [False, True]))

#    for chtype in TPC_CHUNKTYPES:
#        for pol in TPC_POLTYPES:
#            key = chtype+pol
#            retdict.update(discVar2Feature(cnt[key], key, lims = [1,3], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict)
    return (featureVals, featureSets)
Exemplo n.º 14
0
def netPolarChunksFeature(procTxt, hr, featureVals = {}):
    featureVals = netPolarChunks(procTxt, hr, featureVals)
    cnt = featureVals['netPolarChunks']

    #print cnt
    retdict = dict()
    retdict.update(discVar2Feature(cnt, 'netPolarChunks', lims = [-1,1], collapse = [False, True]))

#    for chtype in TPC_CHUNKTYPES:
#        for pol in TPC_POLTYPES:
#            key = chtype+pol
#            retdict.update(discVar2Feature(cnt[key], key, lims = [1,3], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict)
    return (featureVals, featureSets)
Exemplo n.º 15
0
def countNGInTelecomDictFeature(tokTag, hr, featureVals = {}):
    """
    Telecom Dict feature
    """

    #featureVals = countNGInTelecomDict(tokTag, hr, featureVals)
    featureVals = countNGInDomainDict(tokTag, hr, featureVals)
    ncount = featureVals['countNGInDomainDict']

    ngname = 'NG In TELCOM Dict'
    lims = [1,3]
    collapse = [False, True]
    featureSets = {}
    for k in ncount:
        tdict = discVar2Feature(len(ncount[k]), k + ngname, lims = lims, collapse = collapse) #negative smiley
        featureSets.update(tdict.items())

    return (featureVals, featureSets)
Exemplo n.º 16
0
def countNGInTelecomDictFeature(tokTag, hr, featureVals = {}):
    """
    Telecom Dict feature
    """

    #featureVals = countNGInTelecomDict(tokTag, hr, featureVals)
    featureVals = countNGInDomainDict(tokTag, hr, featureVals)
    ncount = featureVals['countNGInDomainDict']

    ngname = 'NG In TELCOM Dict'
    lims = [1,3]
    collapse = [False, True]
    featureSets = {}
    for k in ncount:
        tdict = discVar2Feature(len(ncount[k]), k + ngname, lims = lims, collapse = collapse) #negative smiley
        featureSets.update(tdict.items())

    return (featureVals, featureSets)
Exemplo n.º 17
0
def countPolarPOSFeature(tokTag, hr, featureVals = {}):
    """
    count Polar POS Feature Encoding
    5 level discretization
    """
    featureVals = countPolarPOS(tokTag, hr, featureVals)
    cnt = featureVals['countPolarPOS']

    #work on this should not have to deal with labels here....
    senlbls = ['negative', 'positive']
    POSLbls = ['adjective', 'adverb', 'verb'] #,'noun','interjection']
    retdict = dict()
    for pos in POSLbls:
        for sen in senlbls:
            retdict.update(discVar2Feature(cnt[sen][pos], sen +' '+ pos, lims = [1,3], collapse = [False, True]))
            #retdict.update(discVar2Feature(cnt[sen][pos], sen +' '+ pos, lims = [1,5], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict)
    return (featureVals, featureSets)
Exemplo n.º 18
0
def countPolarPOSFeature(tokTag, hr, featureVals = {}):
    """
    count Polar POS Feature Encoding
    5 level discretization
    """
    featureVals = countPolarPOS(tokTag, hr, featureVals)
    cnt = featureVals['countPolarPOS']

    #work on this should not have to deal with labels here....
    senlbls = ['negative', 'positive']
    POSLbls = ['adjective', 'adverb', 'verb'] #,'noun','interjection']
    retdict = dict()
    for pos in POSLbls:
        for sen in senlbls:
            retdict.update(discVar2Feature(cnt[sen][pos], sen +' '+ pos, lims = [1,3], collapse = [False, True]))
            #retdict.update(discVar2Feature(cnt[sen][pos], sen +' '+ pos, lims = [1,5], collapse = [False, True]))

    featureSets = {}
    featureSets.update(retdict)
    return (featureVals, featureSets)