Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Load Text Files via Local Source Storage #6776

Open
nadolsw opened this issue Dec 10, 2024 · 2 comments
Open

Unable to Load Text Files via Local Source Storage #6776

nadolsw opened this issue Dec 10, 2024 · 2 comments

Comments

@nadolsw
Copy link

nadolsw commented Dec 10, 2024

Describe the bug

I am attempting to import a set of .txt files for NER using local storage. I have had no problem configuring the storage mount and using it to import image files for CV tasks. However, attempts to import the .txt files results in only the filename showing up in the text field (instead of the actual text content of the file) - see attached.

If I instead manually upload the file through the GUI then it loads just fine (see ID #16 in the screenshot).

My Source storage setting are as follows:
Storage Type = Local Files
Storage Title = NLP
Absolute Local Path = .../pyvenv/labelstudio/data/nlp (Check connection works as expected)
Treat every bucket object as source file = True

To Reproduce
Steps to reproduce the behavior:
Attempt to load a directory containing a set of simple text files via source storage.
Compare the results against manually loading the text files via the GUI.

Expected behavior
I would expect the loading of the files using the local storage option to produce the same results as manually uploading the files through the GUI.

Screenshots

image

image

image

image

Environment

  • OS: Rocky Linux 8.10
  • Label Studio Version: 1.14.0.post0

Additional context

I also tried converting the .txt files to .json and experience the same issue (files load fine when manually uploaded from GUI but do not load text when using local storage mount).

fairytale.json:

{
"data": {
"text": "The Adventure of Sparkle the Brave..."
}
}

image

@heidi-humansignal
Copy link
Collaborator

Hello,

Would it be possible to show what your labeling template is? Ensure that your labeling configuration does not use valueType="url" in the <Text> tag. The valueType="url" tells Label Studio to treat the value as a URL to fetch the content from, which isn't applicable for local text files in this context.

Thank you,
Abu

Comment by Abubakar Saad
Workflow Run

@nadolsw
Copy link
Author

nadolsw commented Dec 12, 2024

I am using the default NER template like so:

image

Setting "Use text from: imported file" results in the text being set to the relative file path (as shown in the previous screenshot). Setting "Use text from: set manually" results in the text being populated with just a '$'.
I don't even see valueType="url" as an option.

Here is the format of my text files (simply contains the document text), this format worked with previous versions of Label Studio. Do I need to format my input files differently?

image

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

No branches or pull requests

2 participants