You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can do this by instantiating the detector yourself:
importcsvimporthtmlimportlangdetectwithopen('rawdata.csv', newline='', encoding="UTF-8") asrawdata:
rawreader=csv.reader(rawdata, delimiter=',', quotechar='"')
# instantiate the DetectorFactoryfactory=langdetect.detector_factory.DetectorFactory()
factory.load_profile(langdetect.detector_factory.PROFILES_DIRECTORY)
forrowinrawreader:
# this re-creates the detector each timedetector=factory.create()
# or whatever your text probabilities are.detector.set_prior_map({"en": 0.5, "de": 0.5})
# give the detector the text to run ondetector.append(row[column])
# let the detector run!print(detector.detect())
can i just specify languages that i want to detect, such as only detect en, ja and zh-cn?
The text was updated successfully, but these errors were encountered: