ImportError: cannot import name 'combined_rule_sentence_segmenter' - python

I'm facing error while importing "import en_ner_bc5cdr_md"
import scispacy
import spacy
from spacy import displacy
from collections import Counter
import en_core_web_sm
import en_ner_bc5cdr_md
import en_core_sci_sm
import en_core_sci_md
import en_ner_bionlp13cg_md
from scispacy.abbreviation import AbbreviationDetector
from scispacy.umls_linking import UmlsEntityLinker
from collections import OrderedDict
from pprint import pprint
Please help

You need to download the model first, try
!pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.1/en_ner_bc5cdr_md-0.5.1.tar.gz

Related

Python: Import could not be resolved

These are the imports I am trying to import:
import json
import os
import re
import uuid
from google.auth.transport.requests import AuthorizedSession
from google.oauth2 import service_account
from google.auth import jwt, crypt
But I am getting this error:
Import "google.auth.transport.requests" could not be resolved Pylance(reportMissingImport)
Import "google.oauth2" could not be resolved Pylance(reportMissingImport)
Import "google.auth" could not be resolved Pylance(reportMissingImport)
Thanks for the answers in advance!

ImportError: cannot import name 'MarianMTModel'

import numpy as np
import torch
import torchvision
from transformers import MarianTokenizer, MarianMTModel
from typing import List
I'm getting
ImportError: cannot import name 'MarianMTModel'
I've already installed transformers. What can I do to solve this issue?
Edit : Does this import Marian model implemented in C++?

ModuleNotFoundError: No module named 'Session'

When I run my python script file.py, I get an error ModuleNotFoundError: No module named 'Session'.
The imports on my script:
import os
import sys
import tensorflow as tf
import numpy as np
import random
import time
import requests
from requests import Request, Session
from flask_session import Session
from flask_session.__init__ import Session
import Session
from setup_inception import ImageNet, InceptionModel
You should not use from flask_session import Session
Instead use from flask_session.__init__ import Session
I'm sorry for the late answer, I have solved the problem with command:
import tensorflow.compat.v1 as tf
instead of
import tensorflow as tf
because I 'm using tensorflow 2.4

No module named 'ray.rllib.agents.ppo.ppo_policy'

I have this code:
from copy import deepcopy
import json
import ray
try:
from ray.rllib.agents.agent import get_agent_class
except ImportError:
from ray.rllib.agents.registry import get_agent_class
from ray.rllib.agents.ppo.ppo_policy import PPOTFPolicy
from ray import tune
from ray.tune.registry import register_env
from ray.tune import run_experiments
I am getting the error:
No module named 'ray.rllib.agents.ppo.ppo_policy'
I tried:
pip install ray;
I re installed the system and reconfigured the environment to solve this problem

Python to exe with pyinstaller using anaconda is a huge file

When i do this imports and i create a exe file with pyinstaller. The dist folder is huge (+900Mbs). How can i reduce this?
import queue
import threading
import time
import dateutil.parser
import getpass
import json
import pandas as pd
import pickle
import pprint
import requests
import sys
import urllib3
import xlrd as xl
import xlwings as xw
import PySimpleGUI as sg
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from pathlib import Path
from openpyxl import load_workbook, cell
from pandas import ExcelWriter
from datetime import datetime, date
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session

Categories