Skip to content

Conversation

@makseq
Copy link
Member

@makseq makseq commented Jun 23, 2022

image

This PR adds the Add Or Modify Data Field action in the Data Manager. You can filter some tasks and then add data fields to them. Then you will be able to filter out by these new fields.

To enable this functionality, run LS like this:

EXPERIMENTAL_FEATURES=1 label-studio

Number

Add new data field with float value.

String

Add new data field with string value.

Expressions

permutative sampling:

sample()

> sample()  # => if N_tasks=4 => 4, 1, 3, 2 

uniform random from min integer to max integer:

random(<min_int>, <max_int>)

> random(1, 3)  # => 1, 3, 2, ..., N_tasks

random sampling for string or integer choices with weights:

choices(["<value1>", "<value2>", ...], [<weight1>, <weight2>, ...])

> choices(["a", "b"], [0.4, 0.6])  # => "a", "b", "b", "b", ..., N_tasks

# split dataset into train/test/valid subsets with weights train=90%, test=5%, validation=5%
> choices(['train', 'test', 'valid'], [0.9, 0.05, 0.05])  

replace old substring to the new substring:

replace("old-string", "new-string")

> replace("a", "b")  # => abc => bbc

@codecov
Copy link

codecov bot commented Jun 23, 2022

Codecov Report

Merging #2558 (5bd4191) into develop (17b40da) will decrease coverage by 0.61%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #2558      +/-   ##
===========================================
- Coverage    77.80%   77.18%   -0.62%     
===========================================
  Files          137      141       +4     
  Lines         9951    10348     +397     
===========================================
+ Hits          7742     7987     +245     
- Misses        2209     2361     +152     
Impacted Files Coverage Δ
label_studio/label_studio/users/mixins.py 75.00% <0.00%> (-12.50%) ⬇️
...bel_studio/label_studio/organizations/functions.py 66.66% <0.00%> (-10.26%) ⬇️
...l_studio/label_studio/core/templatetags/filters.py 48.75% <0.00%> (-6.20%) ⬇️
label_studio/label_studio/users/api.py 80.45% <0.00%> (-3.88%) ⬇️
.../label_studio/data_manager/actions/experimental.py 16.23% <0.00%> (-3.28%) ⬇️
label_studio/label_studio/ml/serializers.py 92.30% <0.00%> (-2.43%) ⬇️
label_studio/label_studio/core/utils/contextlog.py 44.55% <0.00%> (-2.33%) ⬇️
label_studio/label_studio/tasks/serializers.py 84.27% <0.00%> (-2.27%) ⬇️
label_studio/label_studio/tasks/models.py 87.85% <0.00%> (-2.20%) ⬇️
...abel_studio/label_studio/data_manager/functions.py 64.70% <0.00%> (-1.97%) ⬇️
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 212ae24...5bd4191. Read the comment docs.

@makseq makseq merged commit a7a1646 into develop Jun 24, 2022
@makseq makseq deleted the fb-feat/add-data-field branch June 24, 2022 22:45
@hadiyouness10
Copy link

hadiyouness10 commented Aug 8, 2022

Hello, I added a new data field called random with an expression of random(min, max).
The column is added and the values are random as expected. However, when I try to sort, nothing changes

@hadiyouness10
Copy link

It seems that adding images using the upload button and then creates the data field works fine. However, adding data using the cloud storage (locally) and then creating the data field doesn't allow ordering or filtering on the created field

@makseq makseq changed the title feat: Experimental feature Add data field feat: Experimental feature Add data field or Add tags Oct 18, 2022
@makseq makseq changed the title feat: Experimental feature Add data field or Add tags feat: Experimental feature Add data field or Add tags or Modify fields Feb 2, 2023
@github-actions github-actions bot added the feat label Feb 2, 2023
@HumanSignal HumanSignal deleted a comment from ammarsufyan Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants