Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Python directions in README are wrong #221

Open
ericchansen opened this issue May 31, 2023 · 1 comment
Open

Python directions in README are wrong #221

ericchansen opened this issue May 31, 2023 · 1 comment

Comments

@ericchansen
Copy link

The "running from Python" instructions in your README are wrong or outdated.

Your README includes the following.

from label_studio_converter import Converter

c = Converter('examples/sentiment_analysis/config.xml')
c.convert_to_json('examples/sentiment_analysis/completions/', 'tmp/output.json')

This code raises TypeError: __init__() missing 1 required positional argument: 'project_dir'.

It's clear from the definition of Converter https://github.com/heartexlabs/label-studio-converter/blob/master/label_studio_converter/converter.py#L145-L160 that project_dir is required.

@williamAddison
Copy link

I had this same issue and I completely agree the documentation for this needs to be updated because it is not reflective at all for what is actually going on in the code.

To solve the issue that you were experiencing(at least for the JSON configuration) I did the following:
`def makeJsonLS(src):

c = Converter("./label.xml", src)
c.convert_to_json(src, 'out.json')`

where src is just the source directory of my images and ./label/xml is the related xml labeling configuration file for the images

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants