Python Forum
python error: bad character range \|-t at position 12
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python error: bad character range \|-t at position 12
#1
i am new to emotion recogntion. When i run the model based on https://github.com/declare-lab/MELD. It is errors.

the command is python baseline.py -classify [Sentiment|Emotion] -modality [text|audio|bimodal] [-train|-test].

it reported error: bad character range \|-t at position 12.

the error as follows:
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-10-8cf05a7e7d1a> in <module>
----> 1 get_ipython().run_line_magic('run', 'baseline.py -classify [Sentiment|Emotion] -modality [text|audio|bimodal] [-train|-test]')

F:\Anaconda\lib\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2325 kwargs['local_ns'] = self.get_local_scope(stack_depth)
2326 with self.builtin_trap:
-> 2327 result = fn(*args, **kwargs)
2328 return result
2329

<decorator-gen-53> in run(self, parameter_s, runner, file_finder)

F:\Anaconda\lib\site-packages\IPython\core\magic.py in <lambda>(f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

F:\Anaconda\lib\site-packages\IPython\core\magics\execution.py in run(self, parameter_s, runner, file_finder)
736 else:
737 # tilde and glob expansion
--> 738 args = shellglob(map(os.path.expanduser, arg_lst[1:]))
739
740 sys.argv = [filename] + args # put in the proper filename

F:\Anaconda\lib\site-packages\IPython\utils\path.py in shellglob(args)
324 unescape = unescape_glob if sys.platform != 'win32' else lambda x: x
325 for a in args:
--> 326 expanded.extend(glob.glob(a) or [unescape(a)])
327 return expanded
328

F:\Anaconda\lib\glob.py in glob(pathname, recursive)
19 zero or more directories and subdirectories.
20 """
---> 21 return list(iglob(pathname, recursive=recursive))
22
23 def iglob(pathname, *, recursive=False):

F:\Anaconda\lib\glob.py in _iglob(pathname, recursive, dironly)
55 yield from _glob2(dirname, basename, dironly)
56 else:
---> 57 yield from _glob1(dirname, basename, dironly)
58 return
59 # os.path.split() returns the argument itself as a dirname if it is a

F:\Anaconda\lib\glob.py in _glob1(dirname, pattern, dironly)
83 if not _ishidden(pattern):
84 names = (x for x in names if not _ishidden(x))
---> 85 return fnmatch.filter(names, pattern)
86
87 def _glob0(dirname, basename, dironly):

F:\Anaconda\lib\fnmatch.py in filter(names, pat)
50 result = []
51 pat = os.path.normcase(pat)
---> 52 match = _compile_pattern(pat)
53 if os.path is posixpath:
54 # normcase on posix is NOP. Optimize it away from the loop.

F:\Anaconda\lib\fnmatch.py in _compile_pattern(pat)
44 else:
45 res = translate(pat)
---> 46 return re.compile(res).match
47
48 def filter(names, pat):

F:\Anaconda\lib\re.py in compile(pattern, flags)
250 def compile(pattern, flags=0):
251 "Compile a regular expression pattern, returning a Pattern object."
--> 252 return _compile(pattern, flags)
253
254 def purge():

F:\Anaconda\lib\re.py in _compile(pattern, flags)
302 if not sre_compile.isstring(pattern):
303 raise TypeError("first argument must be string or compiled pattern")
--> 304 p = sre_compile.compile(pattern, flags)
305 if not (flags & DEBUG):
306 if len(_cache) >= _MAXCACHE:

F:\Anaconda\lib\sre_compile.py in compile(p, flags)
762 if isstring(p):
763 pattern = p
--> 764 p = sre_parse.parse(p, flags)
765 else:
766 pattern = None

F:\Anaconda\lib\sre_parse.py in parse(str, flags, state)
946
947 try:
--> 948 p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
949 except Verbose:
950 # the VERBOSE flag was switched on inside the pattern. to be

F:\Anaconda\lib\sre_parse.py in _parse_sub(source, state, verbose, nested)
441 start = source.tell()
442 while True:
--> 443 itemsappend(_parse(source, state, verbose, nested + 1,
444 not nested and not items))
445 if not sourcematch("|"):

F:\Anaconda\lib\sre_parse.py in _parse(source, state, verbose, nested, first)
832 sub_verbose = ((verbose or (add_flags & SRE_FLAG_VERBOSE)) and
833 not (del_flags & SRE_FLAG_VERBOSE))
--> 834 p = _parse_sub(source, state, sub_verbose, nested + 1)
835 if not source.match(")"):
836 raise source.error("missing ), unterminated subpattern",

F:\Anaconda\lib\sre_parse.py in _parse_sub(source, state, verbose, nested)
441 start = source.tell()
442 while True:
--> 443 itemsappend(_parse(source, state, verbose, nested + 1,
444 not nested and not items))
445 if not sourcematch("|"):

F:\Anaconda\lib\sre_parse.py in _parse(source, state, verbose, nested, first)
596 if hi < lo:
597 msg = "bad character range %s-%s" % (this, that)
--> 598 raise source.error(msg, len(this) + 1 + len(that))
599 setappend((RANGE, (lo, hi)))
600 else:

error: bad character range \|-t at position 12


how to fix it?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  matplotlib x axis range goes over the set range Pedroski55 5 271 Nov-21-2021, 08:40 AM
Last Post: paul18fr
  Python Error List Index Out of Range abhi1vaishnav 3 439 Sep-03-2021, 08:40 PM
Last Post: abhi1vaishnav
  [solved] unexpected character after line continuation character paul18fr 4 783 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  Reducing JSON character count in Python for a Twitter Bot johnmitchell85 2 820 Apr-28-2021, 06:08 PM
Last Post: johnmitchell85
  Error with non-ASCII character? giomach 10 2,075 Nov-09-2020, 01:13 PM
Last Post: giomach
  List index out of range error while accessing 2 lists in python K11 2 880 Sep-29-2020, 05:24 AM
Last Post: K11
  List index out of range error when attempting to make a basic shift code djwilson0495 4 1,190 Aug-16-2020, 08:56 PM
Last Post: deanhystad
  SyntaxError: unexpected character after line continuation character siteshkumar 2 1,267 Jul-13-2020, 07:05 PM
Last Post: snippsat
  Help ANSI character and python... sid4g 2 1,071 Mar-19-2020, 06:08 PM
Last Post: sid4g
  Define a range, return all numbers of range that are NOT in csv data KiNeMs 18 3,168 Jan-24-2020, 06:19 AM
Last Post: KiNeMs

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020