This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.tokenize import word_tokenize, sent_tokenize | |
from nltk.tag import StanfordNERTagger | |
st = StanfordNERTagger('/Users/Downloads/stanford-ner-2020-11-17/classifiers/english.all.3class.distsim.crf.ser.gz', | |
'/Users/Downloads/stanford-ner-2020-11-17/stanford-ner.jar', | |
encoding='utf-8') | |
text_string=''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stream=[1,2,3,4,5,6,4,2,5,9,1,6,3,7,1,2,2,4,2,1] | |
print('Using conventional Algorithm:') | |
start_time = time.time() | |
st_unique=[] | |
for i in stream: | |
if i in st_unique: | |
continue | |
else: | |
st_unique.append(i) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stream=[1,2,3,4,5,6,4,2,5,9,1,6,3,7,1,2,2,4,2,1] | |
print('Using Flajolet Martin Algorithm:') | |
import time | |
start_time = time.time() | |
maxnum=0 | |
for i in range(0,len(stream)): | |
val= bin((1*stream[i] + 6) % 32)[2:] | |
sum=0 |