Not able to import simpletransformers.ner in python as it says ImportError: cannot import name 'BertweetTokenizer' - bert-language-model

I am trying to do bert based NER and trying to import,
from simpletransformers.ner import NERModel, NERArgs
I have installed simpletranformers in pip and when I try to import,
import simpletransformers.ner
it says, ImportError: cannot import name 'BertweetTokenizer'. When I try to install BertweetTokenizer, it throws
ERROR: No matching distribution found for BertweetTokenizer
Not sure, what I am missing. Kindly help

Related

importing SQLite3 in GoLang

I want to import SQLite3 for my Project
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
)
But this Error happened:
could not import github.com/mattn/go-sqlite3 (no required module provides package "github.com/mattn/go-sqlite3")
I checked my GOPATH and go module but i couldn't fix it.
thanks for helping me out.

ImportError: cannot import name 'pytext_config_from_json' from 'pytext.config.serialize'

I'm trying to fine-tune XLM-R model by following this colab notebook.
While running the following cell in kaggle notebook
from pytext.config.serialize import pytext_config_from_json
I'm getting the error
ImportError: cannot import name 'pytext_config_from_json' from 'pytext.config.serialize' (/opt/conda/lib/python3.7/site-packages/pytext/config/serialize.py)
I have installed pytext by
!pip install --quiet git+https://github.com/facebookresearch/pytext
Thanks
Try
from pytext.config import pytext_config_from_json

Error in %conda list biopython in jupyter notebook (macOS)

I use jupyter notebook, I have anaconda installed on the system. I get this error when I import Bio
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-7-de5ff3e63c39> in <module>
----> 1 from Bio import Phylo
2 import wget
3 import re
4 from Bio import SeqIO
5 from Bio.SeqRecord import SeqRecord
ModuleNotFoundError: No module named 'Bio'
and when I look at the packages in this path /Users/morteza/anaconda3/lib/python3.7/site-packages/, bio and biopython are there
Can somebody help me with this?
Thanks
I found a solution so I share here maybe will be useful for someone. I changed the name bio to Bio in the path /Users/morteza/anaconda3/lib/python3.7/site-packages/ using mv bio Bio command then the import worked properly.

ImportError: cannot import name 'label_map_util'

I'm running on Python 3.6.5 (64bits) trying to run the object_detection_tutorial.
I receive this message when I run the programm :
ImportError: cannot import name 'label_map_util'
Any idea on what I should do ?
Edit : I tried to see whether or not I installed the API and got this :
C:\tensorflow\models-master>python object_detection/protos/label_map_util_test.py
python: can't open file 'object_detection/protos/label_map_util_test.py': [Errno 2] No such file or directory
Try this instead...
from object_detection.utils import label_map_util
Get current dir :
os.getcwd()
change current dir :
os.chdir( '../models/research/object_detection' )
CD to object_detection directory
And you can replace
from utils import label_map_util to
from object_detection.utils import label_map_util
and
from utils import visualization_utils as vis_util to
from object_detection.utils import visualization_utils as vis_util

py2app: Compiles app but app has error on opening

I am working on a Python application in Python3.6 that I would like to convert into a standalone application that can be ported easily to other devices. I tried using py2app as in this tutorial.
Everything works well until I get to the point of actually creating the app. It does not throw any error in the creation process and creates the .app file, however, when I try to run it, A window pops up saying there is an error and gives me the options of terminating or opening the console. I tried opening the console but I cannot find any substantive information in the error messages.
These are the import statements that I have:
from urllib.request import urlopen, build_opener
from bs4 import BeautifulSoup, SoupStrainer
import ssl
import urllib
import sys
import subprocess
from tkinter import *
from tkinter.ttk import *
import webbrowser
from unidecode import unidecode
As far as I know the only 2 packages that aren't standard with python are bs4 and unidecode. My setup.py file looks like this:
from setuptools import setup
APP = ['GUImain.py']
DATA_FILES = ['logo.png']
OPTIONS = {'argv_emulation': True,
'iconfile': 'logo.png',
'includes': ['undidecode','bs4']}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
I haven't seen any other errors like this one from any of my searching. I have seen some suggestion that py2app doesn't fully support Python3.6. Does anyone know how I can figure out what error is being thrown? Any suggestions on different tools to use and tutorials on how to use them?

Resources